I have two drop menus. the "choose a state" menu and "select a carrier" menu. Here's the thing: I want my drop menus to behave like my "state" menu, in that it moves content below it downwards. However, I want them to look like my "carrier" menu, in that it looks like two separate menus when you click on it. Here is my fiddle for code reference: http://jsfiddle.net/SteveSerrano/rc7fhhhu/
Note: The only difference between the two menus is that "state" is positioned "relative" with a z-index of 9999. "carrier" is positioned "absolute" with a z-index of 9999. I'm lost. Need any help. Thanks :)
<div class="state_box">
<input type="checkbox" id="state-tgl" onblur="closeMenu(this)">
<label id="state-tgl-label" for="state-tgl">
<span class="collapse_tiny">Choose a state</span>
<span class="collapse expand_tiny inline">State</span>
<img src="/images/template2014/dropdown-black.svg" style="vertical-align:middle; width:10px;">
</label>
<ul id="state_drop-menu">
<li><span class="collapse_tiny">Connecticut</span></li>
<li><span class="collapse_tiny">New Hampshire</span></li>
<li><span class="collapse_tiny">New Jersey</span></li>
<li><span class="collapse_tiny">New York</span></li>
</ul>
<div class="carrier_box">
<input type="checkbox" id="carrier-tgl" onblur="closeMenu(this)">
<label id="carrier-tgl-label" for="carrier-tgl">
<span class="collapse_tiny">Select a carrier</span>
<span class="collapse expand_tiny inline">State</span>
<img src="/images/template2014/dropdown-black.svg" style="vertical-align:middle; width:10px;">
</label>
<ul id="carrier_drop-menu">
<li><span class="collapse_tiny">Carrier 1</span><span class="collapse expand_tiny inline">Conn.</span></li>
<li><span class="collapse_tiny">Carrier 2</span><span class="collapse expand_tiny inline">N.H.</span></li>
<li><span class="collapse_tiny">Carrier 3</span><span class="collapse expand_tiny inline">N.J.</span></li>
<li><span class="collapse_tiny">Carrier 4</span><span class="collapse expand_tiny inline">N.Y</span></li>
</ul>
CSS CODE:
.state_box{
margin-bottom:-9px;
background-color:rgba(6, 0, 0, 0.09);
padding-left:10px;
padding-right:10px;
padding-bottom:7px;
padding-top:15px;
width:160px;
}
.state_box ul{
margin:0;
padding:0;
list-style-type: none;
}
.state_box ul li{
display:inline;
}
.state_box ul ul{
display:inline;
}
.state_box ul li a{
text-decoration:none;
padding-left:16px;
color:#000;
font-family:'Raleway', Arial, Helvetica, sans-serif;
font-weight:500;
font-size:23px; font-size:2.3rem;
text-transform:uppercase;
vertical-align:-8px;
color:#939598;
}
.state_box ul li a.first_state{
padding-left:0px;
}
.state_box ul li .third_level{
color:#a7a9ac;
font-size:18px; font-size:1.8rem;
vertical-align:-5px;
}
.state_box ul li .fourth_level{
color:#BCBEC0;
font-size:14px; font-size:1.4rem;
vertical-align:-3px;
}
.state_box ul li a:hover{
color:#808285;
}
.state_box ul li .selected_state{
font-size:36px; font-size:3.6rem
color:#000000;
text-transform:uppercase;
vertical-align:text-top;
color:#000;
font-family:'Raleway', Arial, Helvetica, sans-serif;
}
#state-tgl{
position:absolute;
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
/* Real Browsers */
opacity:0;
}
#state-tgl-label{
font-size:28px; font-size:1.8rem;
color:#000000;
font-family:'Raleway', Arial, Helvetica, sans-serif;
/*font-weight:500;*/
display:block;
}
#state-tgl-label img{
float:right;
margin-top:5px;
}
#state_drop-menu{
position:relative;
z-index:9999;
background-color:rgba(6, 0, 0, 0.09);
/*border:solid 2px black;*/
width:200px;
padding-top:8px;
padding-bottom:8px;
display:none;
max-height:0px;
transition: max-height 0.25s ease;
margin-left:-10px;
margin-top:10px;
}
#state_drop-menu li{
display:block;
padding:0px;
margin:0px;
width:100%;
}
#state_drop-menu li a{
font-size:36px; font-size:1.8rem;
color:black;
padding:0px;
margin:0px;
display:block;
padding-left:8px;
padding-right:8px;
}
#state_drop-menu li a:hover{
color:white;
background-color:black;
}
#state-tgl:checked ~ #state_drop-menu{
display:block;
max-height:1000px;
}
/*########### Carrier Drop Menu ############*/
.carrier_box{
margin-bottom:-9px;
background-color:rgba(6, 0, 0, 0.09);
padding-left:10px;
padding-right:10px;
padding-bottom:7px;
padding-top:15px;
width:320px;
}
.carrier_box ul{
margin:0;
padding:0;
list-style-type: none;
}
.carrier_box ul li{
display:inline;
}
.carrier_box ul ul{
display:inline;
}
.carrier_box ul li a{
text-decoration:none;
padding-left:16px;
color:#000;
font-family:'Raleway', Arial, Helvetica, sans-serif;
font-weight:500;
font-size:23px; font-size:2.3rem;
text-transform:uppercase;
vertical-align:-8px;
color:#939598;
}
.carrier_box ul li a.first_carrier{
padding-left:0px;
}
.carrier_box ul li .third_level{
color:#a7a9ac;
font-size:18px; font-size:1.8rem;
vertical-align:-5px;
}
.carrier_box ul li .fourth_level{
color:#BCBEC0;
font-size:14px; font-size:1.4rem;
vertical-align:-3px;
}
.carrier_box ul li a:hover{
color:#808285;
}
.carrier_box ul li .selected_carrier{
font-size:36px; font-size:3.6rem
color:#000000;
text-transform:uppercase;
vertical-align:text-top;
color:#000;
font-family:'Raleway', Arial, Helvetica, sans-serif;
}
#carrier-tgl{
position:absolute;
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
/* Real Browsers */
opacity:0;
}
#carrier-tgl-label{
font-size:28px; font-size:1.8rem;
color:#000000;
font-family:'Raleway', Arial, Helvetica, sans-serif;
/*font-weight:500;*/
display:block;
}
#carrier-tgl-label img{
float:right;
margin-top:5px;
}
#carrier_drop-menu{
position:absolute;
z-index:9999;
background-color:rgba(6, 0, 0, 0.09);
/*border:solid 2px black;*/
width:320px;
padding-top:8px;
padding-bottom:8px;
display:none;
max-height:0px;
transition: max-height 0.25s ease;
margin-left:-10px;
margin-top:10px;
}
#carrier_drop-menu li{
display:block;
padding:0px;
margin:0px;
width:100%;
}
#carrier_drop-menu li a{
font-size:36px; font-size:1.8rem;
color:black;
padding:0px;
margin:0px;
display:block;
padding-left:8px;
padding-right:8px;
}
#carrier_drop-menu li a:hover{
color:white;
background-color:black;
}
#carrier-tgl:checked ~ #carrier_drop-menu{
display:block;
max-height:1000px;
}
#charts{
margin-top:50px;
}
This should be a good start: move your background-color from .state-box and move it onto:
#state-tgl-label {
background-color:rgba(6, 0, 0, 0.09);
}
That way only the label gets the background color, and not the whole surrounding div. The reason you need to keep position: relative is that using position: absolute takes it out of the flow of the document, which prevents your desired effect of moving the other elements of the page down when opened.
Here's a quick fiddle: http://jsfiddle.net/rc7fhhhu/1/
updated fiddle: http://jsfiddle.net/rc7fhhhu/2/
I've removed margin-left: -10px from the ul element, and moved the padding onto the #state-tgl-label element. Should be pretty close to what you were looking for.
Related
I got 2 questions.
1st: How do I put my Logo + Brand Text inside my navbar? I want it at the left end of the nav and inline.
2nd: I want it to appear at the center of my Mob Menu.
I tried putting it at li tag but someone told me it shouldn't be there. So, I'm kinda clueless where will I put it and what tag will I use and how will I insert it in the nav. I've been figuring it out for almost 2 weeks now but I just destroy some elements.
HTML:
<div id="fixed">
<div id="search-wrap" class="wrap-top search-wrap">
<div class="width">
<ul class="clearfix">
<li ><i class="fa fa-search"></i> <input type='search' placeholder="Search..."></li>
<li id="li-3">Search</li>
<li id="li-4"> <i class="fa fa-times"></i> </li>
</ul>
</div>
</div>
<div id="tags-wrap" class="wrap-top tags-wrap">
<div class="width">
<ul class="clearfix">
<li>tag#1</li>
<li>tag#2</li>
</ul>
<div id="search-results"></div>
</div>
</div>
<div id="nav-wrap" class="wrap-top nav-wrap">
<div class="width">
<ul class="clearfix">
<li>Link#1<span>Sub-link#1</span></li>
<li>Link#2<span>Sub-link#2</span></li>
<li id="search-btn" class="s-desk"> <i class="fa fa-search"></i> </li>
</ul>
<i class="fa fa-reorder fa-2x menu-mob" id="menu-mob"></i>
</div>
</div>
</div>
</div>
CSS:
#fixed{
position:fixed;
z-index:1000;
width:100%;
top:0;
}
.wrap-top{
height:70px;
width:100%;
line-height:70px;
}
.wrap-top ul{
position:relative;
width:100%;
height:100%;
}
.wrap-top ul li{
float:left;
list-style:none;
text-align:center;
text-transform:uppercase;
font-size:21px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
height:100%;
}
.width{
max-width:800px;
width:100%;
margin: 0 auto;
height:100%;
}
#search-wrap{background:#253444;}
.search-wrap{margin-top:-70px;}
.search-wrap.active{margin-top:0;}
#search-wrap ul li{
width:75%;
color:#3b5167;
height:70px;
border-right: 1px solid #3b5167 ;
}
#search-wrap ul li:first-child{
border-left: 1px solid #3b5167 ;
position:relative;
}
#search-wrap ul li:first-child i{
position:absolute;
top:23px;
left:3.5%;
color:#3b5167;
}
#search-wrap #li-3{width:15%; cursor:pointer; font-size:18px; color:#97a5b5;}
#search-wrap #li-4{ width:10%; cursor:pointer;}
#search-wrap #li-3:hover, #search-wrap #li-4:hover{ background:#2c3e50; color:#fff;}
#search-wrap input{
text-align:left;
width:100%;
height:100%;
border:none;
outline:none;
padding:4% 4% 4% 10%;
background:none;
color:#fff;
font-size:36px;
font-family: 'Anton', sans-serif;
}
#search-wrap input:focus{ background:#2c3e50;}
input[type='search']::-webkit-search-decoration,
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-results-button,
input[type='search']::-webkit-search-results-decoration {
display: none;
}
#search-wrap input::-webkit-input-placeholder{ color:#3b5167; opacity:1;}
#search-wrap input:-moz-placeholder{color:#3b5167; opacity:1;}
#search-wrap input::-moz-placeholder{color:#3b5167; opacity:1;}
#search-wrap input:-ms-input-placeholder {color:#3b5167; opacity:1;}
.menu-mob{display:none !important;}
#nav-wrap{ background:#fff; line-height:64px;}
.nav-wrap.active, .nav-wrap.active li{ height:50px; line-height:50px;}
.nav-wrap.active ul li#search-btn{ line-height:50px !important;}
.nav-wrap.active ul li:before{display:none;}
.nav-wrap.active ul li span{display:none;}
#nav-wrap ul li{
width:15%;
cursor:pointer;
color:#3b5167;
border-right: 1px solid #cad0d6 ;
position:relative;
}
#nav-wrap ul li:first-child{border-left: 1px solid #cad0d6 ;}
#nav-wrap ul li#search-btn{
width:10%;
line-height:70px;
}
#nav-wrap ul li:hover,
#nav-wrap ul li.active {
color:#FFF;
background:#2c3e50;
}
.nav-wrap ul li span{
display:block;
line-height:0;
font-size:9px;
position:relative;
top:-12px;
color:#415C76;
font-family:Arial, sans serif;
}
.tags-wrap{
height:0px;
background:#3b5167;
overflow:hidden;
}
.tags-wrap.active{
height:50px;
}
.tags-wrap ul li{
font-size:12px;
color:#707f91;
background:#2c3e50;
line-height:20px;
height:auto;
padding:2px 0;
width:8%;
margin:0 1%;
font-family:Arial, sans serif;
text-transform:lowercase;
cursor:pointer;
font-weight:bold;
opacity:0.8;
}
.tags-wrap ul li:hover{
opacity:1;
color:#97a5b5;
}
#search-results{
text-align:center;
color:#fff;
font-family:Arial, sans serif;
height:50px;
line-height:50px;
}
#search-results span{
font-weight:bold;
}
.search-wrap, .tags-wrap, .nav-wrap, #first-row i{
-webkit-transition: all 0.3s cubic-bezier(0, .68, .07, 1);
-moz-transition: all 0.3s cubic-bezier(0, .68, .07, 1);
transition: all 0.3s cubic-bezier(0, .68, .07, 1);
-ms-transition: all 0.3s cubic-bezier(0, .68, .07, 1);
}
My Logo + Brand Text:
<div class='rbanner'>
<a href='/'><img class='sr' align="left" border="0" height="70" src="mylogo.png" />
<span class="sr1">Test</span><span class="sr2">Page</span></a>
</div>
Sample Preview:
Desktop and Mobile View
Thanks!
I have a bunch of inline-blocks which I want to wrap when the browser window is shrunken. They look like this:
[nav element 1] [nav element 2] [nav element 3] [nav element 4]
This is a {h1} header.
When the browser is resized, I want them to wrap, which they do. But they overwrite the header on the next line:
[nav element 1] [nav element 2] [nav element 3]
[nav element 4]eader.
I've tried separating the header with paragraphs and linebreaks. Nope.
I've tried putting a "clear:both" on the {h1} style. Nope.
I've tried putting a {div} around the {h1} with a "display:block" and/or a "clear:both". Nope.
I want the page content to move down when the nav bar wraps.
Any hints?
My code and its results can be seen at criv.com/test
EDIT
body {
margin-left: auto;
margin-right: auto;
width: 80%;
background-color: #FFFFFF;
}
h1 {
display:inline-block;
background:#FF0000;
border:2px solid black;
clear:both;
}
.nav {
display: block;
position: absolute;
top: -1px;
float: left;
overflow: auto;
}
.nav a {
display:inline-block;
width:88px;
height:50px;
font-family:"Comic Sans MS", Arial, Sans-serif;
color:#FFFFFF;
background-color:#008000;
text-align:center;
padding:0px;
margin:0px;
border-style:solid;
border-color:#FFFFFF;
border-width:1px;
text-decoration:none;
}
.nav a:visited {
color:#CCCCCC;
}
.nav a:hover, a:active {
color:#008000;
background-color:#CCCCCC;
}
.nav a#here {
color:#008000;
background-color:white;
}
ul.subnav {
background-color:#009000;
padding:0px;
margin:0px;
border:1px solid #009000;
width:618px;
height:18px;
position:absolute;
top:72px;
left:220px;
}
ul.subnav li {
display:block;
width:123px;
height:18px;
background-color:#009000;
list-style-type:none;
margin:0px;
padding:0px;
border-width:0px;
overflow:hidden;
float:left;
}
ul.subnav a {
display:block;
width:123px;
height:18px;
font-family:"Comic Sans MS", Arial, Sans-serif;
font-size:75%;
font-weight:bold;
color:#FFFFFF;
background-color:#009000;
text-align:center;
padding:0px;
border-width:0px;
margin:0px;
text-decoration:none;
}
ul.subnav a:visited {
color:#CCCCCC;
}
ul.subnav a:hover, a:active {
color:#008000;
background-color:#CCCCCC;
}
ul.subnav a#here {
color:#008000;
background-color:white;
}
.note {
background-color:#7A991A;
}
.text {
background-color:white;
font-family:"Comic Sans MS", Arial, Sans-serif;
color:#008000;
width:80%;
left:10%;
}
.text a:link {
color:#008000;
}
.text a:visited {
color:#999999;
}
<div class="nav">
2014 peony list
bloom calendar
photo gallery
peony<br />how-to's
peony<br />tales
<br />visit
<span class="clearfix">contact/ order</span>
</div>
<br />
<div class="notreally"><h1>peonies of the coos riviera</h1></div>
<span class="text">
Just above the Connecticut River in New Hampshire's Coos County,
more than a hundred varieties of herbaceous peonies, tree peonies,
and intersectional-hybrid peonies bloom from late May to early July.
<p>The display garden has closed for the season. To order peonies for fall planting,
email peonies#criv.com, or phone 603.837.9800.</p>
<p>Review <b>the 2014 bloom season</b> in pictures!</p>
</span>
Remove position absolute from it. If you want nav to push 1px to top then you can use margin-top:-1px
Here is working code.
body {
margin-left: auto;
margin-right: auto;
width: 80%;
background-color: #FFFFFF;
}
h1 {
display:inline-block;
background:#FF0000;
border:2px solid black;
clear:both;
}
.nav {
display: block;
float: left;
overflow: auto;
}
.nav a {
display:inline-block;
width:88px;
height:50px;
font-family:"Comic Sans MS", Arial, Sans-serif;
color:#FFFFFF;
background-color:#008000;
text-align:center;
padding:0px;
margin:0px;
border-style:solid;
border-color:#FFFFFF;
border-width:1px;
text-decoration:none;
}
.nav a:visited {
color:#CCCCCC;
}
.nav a:hover, a:active {
color:#008000;
background-color:#CCCCCC;
}
.nav a#here {
color:#008000;
background-color:white;
}
ul.subnav {
background-color:#009000;
padding:0px;
margin:0px;
border:1px solid #009000;
width:618px;
height:18px;
position:absolute;
top:72px;
left:220px;
}
ul.subnav li {
display:block;
width:123px;
height:18px;
background-color:#009000;
list-style-type:none;
margin:0px;
padding:0px;
border-width:0px;
overflow:hidden;
float:left;
}
ul.subnav a {
display:block;
width:123px;
height:18px;
font-family:"Comic Sans MS", Arial, Sans-serif;
font-size:75%;
font-weight:bold;
color:#FFFFFF;
background-color:#009000;
text-align:center;
padding:0px;
border-width:0px;
margin:0px;
text-decoration:none;
}
ul.subnav a:visited {
color:#CCCCCC;
}
ul.subnav a:hover, a:active {
color:#008000;
background-color:#CCCCCC;
}
ul.subnav a#here {
color:#008000;
background-color:white;
}
.note {
background-color:#7A991A;
}
.text {
background-color:white;
font-family:"Comic Sans MS", Arial, Sans-serif;
color:#008000;
width:80%;
left:10%;
}
.text a:link {
color:#008000;
}
.text a:visited {
color:#999999;
}
<div class="nav">
2014 peony list
bloom calendar
photo gallery
peony<br />how-to's
peony<br />tales
<br />visit
<span class="clearfix">contact/ order</span>
</div>
<br />
<div class="notreally"><h1>peonies of the coos riviera</h1></div>
<span class="text">
Just above the Connecticut River in New Hampshire's Coos County,
more than a hundred varieties of herbaceous peonies, tree peonies,
and intersectional-hybrid peonies bloom from late May to early July.
<p>The display garden has closed for the season. To order peonies for fall planting,
email peonies#criv.com, or phone 603.837.9800.</p>
<p>Review <b>the 2014 bloom season</b> in pictures!</p>
</span>
Can't get my navigation to stay active using html and css. It just light up but does not stay active when pressed. What am I missing?
How do I make it stay active when pressed? Really need the help fast! Sorry for my bad code, I'm new to coding.
How do I type the active class? I tried to, but it did not work.
HTML
<div id="apaknavig">
<div id="menu2">
<ul>
<li>Uzņēmums</li>
<li>kontakti</li>
</ul>
</div>
</div>
CSS
#apaknavig {
Width: 200px;
height: 604px;
top:-613px;
position:relative;
font:14px Arial;
color:black;
float:left;
right:35px;
text-indent:12px;
display: block;
line-height:30px;
}
#menu2 ul{
list-style:none;
float: left;
font:14px Arial;
color:black;
right:90px;
text-decoration:none;
text-align:left; width:10px;
display: block;
line-height:30px;
margin-bottom:10px;
}
#menu2 a{
background-image: url(bildes/apak_navig.png);
display:block;
width: 196px;
height:34px;
font:14px Arial;
color:black;
float:left;
right:90px;
text-decoration:none;
display: block;
line-height:30px;
margin-bottom:3px;
}
#menu2 a:hover{
background-image: url(bildes/apak_navig_green.png);
color:white;
font:14px Arial;
color:black;
text-decoration:none;
display: block;
line-height:30px;
}
Just change #menu2 a:hover{ to #menu2 a:hover, #menu2 a:active {.
You just have to add #menu2 a:active to the CSS.
#menu2 a:hover,#menu2 a:active{
background-image: url(bildes/apak_navig_green.png);
color:white;
font:14px Arial;
color:black;
text-decoration:none;
display: block;
line-height:30px;
}
I tried it but it just does not work. It continues to just hover, but does not stay active when I press it.
On further investigation I have discovered that there is something in my CSS that is making my navigation display funny -> Everything on my innerPage and HTML below (Main Page) load fine but I am still being driven crazy by the nav so I have uploaded my full html and css to resolve this issue,
HTML:
<div id="container">
<header>
<h1>company</h1>
<div id="logo">Home</div>
<section id="sales">
<p></p>
</section>
<section id="searchBox">
<form id="searchBoxForm">
<fieldset>
<input type="text" name="search" id="search" placeholder="Search Here" />
<input class="submit" type="submit" name="submit" id="submit" value="Search" />
</fieldset>
</form>
</section>
</header><!-- Header End -->
<nav id="mainMenu">
<ul>
<li>Nav 1
<ul><!--Sub Menu Hosting -->
<li>Drop Down 1</li>
</ul><!-- Sub Menu Hosting Ends -->
</li>
<li>Nav 2
<ul><!-- Sub Menu Email -->
<li>I want my own email</li>
</ul><!-- Sub Menu Email Ends -->
</li>
<li>Nav 3
<ul><!-- Sub Menu Support -->
<li>Need Support?</li>
</ul><!-- Sub Menu Support Ends -->
</li>
<li>Nav 3
<ul><!-- Sub Menu About -->
<li>About</li>
</ul><!-- Sub Menu About Ends -->
</li>
<li><a class="signup" href="#">SIGN UP</a></li>
</ul>
</nav><!-- Main Menu End -->
<div id="billboard">
<h1 contenteditable="true">Cloud Hosting </h1>
<p>Hosting to take you way above the clouds</p>
</div>
<article id="services">
<section class="service1">
<h2>Plan 1</h2>
<p>Cloud hosting isn't difficult or expensive. OnApp lets hosts deploy clouds in a day, at very low cost.</p>
<p>More</p>
</section>
<section class="service2">
<h2>Plan 2</h2>
<p>OnApp maximizes margins with high density, self-organizing clouds and an intuitive control panel.</p>
<p>More</p>
</section>
<section class="service3">
<h2>Plan 3</h2>
<p>No more late-night fixes in the data center. OnApp has automatic failover and multi-layered security. </p>
<p>More</p>
</section>
<section class="service4">
<h2>MS Exchange</h2>
<p>OnApp's fine control of permissions, limits and pricing lets you tailor the customer experience.</p>
<p>More</p>
</section>
<section class="service5">
<h2>Domains</h2>
<p>OnApp's fine control of permissions, limits and pricing lets you tailor the customer experience.</p>
<p>More</p>
</section>
</article><!-- Services End -->
<div id="servicesBanner">
<p>Services: </p>
</div>
<ul id="nav-footer">
<div id="col">
</div>
<p>©</p>
</div> <!-- container -->
</body>
</html>
CSS:
body {
line-height:1;
font:12px normal helvetica,arial,sans-serif;
color:gray;
background:url(includes/images/body-bg.png) 0 0 repeat-x #efefef;
}
ol,ul {
list-style:none;
}
blockquote,q {
quotes:none;
}
blockquote:before,blockquote:after,q:before,q:after {
content:none;
}
h1 {
margin-bottom:20px;
font-size:36px;
line-height:40px;
color:#58585a;
font-weight:700;
}
h2 {
padding-bottom:9px;
border-bottom:1px solid #e5e5e5;
font-size:18px;
line-height:30px;
color:#58585a;
font-weight:700;
margin:40px 0 10px;
}
h3 {
margin-bottom:3px;
font-size:14px;
line-height:20px;
color:#58585a;
font-weight:700;
}
h4 {
font-size:12px;
font-weight:700;
color:#58585a;
line-height:20px;
}
ol {
list-style:decimal;
margin:0 0 20px 16px;
}
strong {
color:#4a4a4a;
}
.subheading {
margin-bottom:40px;
font-size:16px;
line-height:24px;
}
h1.small {
font-size:26px;
line-height:36px;
}
#container {
width:960px;
margin:0 auto;
padding:0 0 40px;
}
pre {
border-left:2px solid #00afd8;
background:url(/assets/img/pre-bg.png);
font-size:12px;
line-height:20px;
width:620px;
overflow:auto;
overflow-y:hidden;
margin:0;
padding:0;
}
code {
display:block;
margin:0 0 0 10px;
}
header{
z-index:100;
margin-bottom:-30px;
width:100%;
height:100px;
}
header h1{
font-family: 'Springsteel Lig', arial, serif;
}
h1#logo,#logo a {
display:block;
left:0;
top:30px;
text-indent:-99999px;
width:193px;
height:41px;
margin:0;
}
/* Main Menu */
#mainMenu{
height:50px;
margin:0 0 15px 0px;
background-color:#6a6a6a;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}
#mainMenu ul{
display:inline;
-webkit-border-bottom-right-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-bottomright:2px;
-moz-border-radius-bottomleft:2px;
}
#mainMenu ul li{
margin-left:0px;
width:120px;
height:56px;
display:inline;
position:relative;
}
#mainMenu li a {
float:left;
display:block;
text-decoration:none;
width:120px;
height:35px;
font-size:13px;
line-height:45px;
text-align:center;
color:#fff;
text-transform:uppercase;
padding-top:-4px;
margin:0px;
}
#mainMenu li a:hover, #mainMenu li a:active{
text-decoration:none;
background-color:#7a7a7a;
color:#fff;
width:120px;
height:50px;
-webkit-border-top-left-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-topleft:2px;
-moz-border-radius-topleft:2px;
}
#mainMenu .signup{
background-color:#69c21c;
height:50px;
margin-left:360px;
-webkit-border-top-right-radius:2px;
-webkit-border-bottom-right-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-bottomright:2px;
}
#mainMenu .signup:hover{
background-color:#00afd8;
}
/*mainMenu Sub Menu */
#mainMenu ul li ul{
display:none;
background-color:#7a7a7a;
}
#mainMenu ul li:hover ul{
text-transform:none;
display:block;
position:absolute;
width:115px;
top:50px;
right:-37px;
}
#mainMenu ul li:hover ul a{
float:left;
margin:0 0 0 -35px;
line-height:35px;
width:150px;
height:35px;
border:none;
font-size:12px;
text-align:left;
text-transform:none;
}
#mainMenu ul li ul li a:hover{
width:152px;
height:30px;
font-weight:bold;
margin-left:-38px;
line-height:35px;
}
footer{
clear:both;
border-top: 1px solid #d3d3d3;
width:100%;
height:50px;
}
#sales {
width:160px;
height:30px;
float:right;
margin-top:-140px;
margin-right:215px;
}
/*Sales */
#sales p{
font-weight:bold;
text-align:center;
line-height:45px;
}
/*Search Bpx */
#searchBox{
float:right;
margin-top:-125px;
}
#searchBoxForm{
margin-top:10px;
}
#searchBoxForm .search {
font-size: 11px;
color: #fff;
padding: 6px;
border: 1px solid #b8b8b8;
-moz-border-radius:2px;
border-radius:2px
}
#searchBoxForm .submit {
background-color:#00afd8;
width: 67px;
height: 26px;
border: none;
color: #fff;
cursor: pointer;
-moz-border-radius:2px;
border-radius:2px
}
#searchBoxForm .submit:hover,
#searchBoxForm .submit.hover {
background-color:#00afd8;
}
/* Billboard */
#billboard {
min-height:240px;
background:#00afd8;
font-size:16px;
line-height:24px;
color:#fff;
-webkit-border-top-left-radius:3px;
-webkit-border-top-right-radius:3px;
-moz-border-radius-topleft:3px;
-moz-border-radius-topright:3px;
padding:34px 520px 60px 40px;
}
#billboard h1 {
font-family:arial;
margin-bottom:20px;
font-size:36px;
line-height:40px;
color:#fff;
}
#billboard a {
color:#fff;
text-decoration:underline;
}
#services {
background-color:#fff;
-webkit-border-bottom-right-radius:3px;
-webkit-border-bottom-left-radius:3px;
-moz-border-radius-bottomright:3px;
-moz-border-radius-bottomleft:3px;
}
#services a{
text-decoration:none;
}
#services h2 {
position:relative;
border:0;
background:url(/assets/img/sections/home/services-icons.png) 0 0 no-repeat;
margin:-40px 0 3px;
padding:0;
}
#services h2 a {
display:block;
color:#58585a;
padding:94px 0 0;
}
#services .service1 {
padding-left:20px;
border-left:0;
}
#services .service2 h2 {
background-position:-168px 0;
}
#services .service3 h2 {
background-position:-336px 0;
}
#services .service4 h2 {
background-position:-504px 0;
}
#services .service5 h2 {
background-position:-672px 0;
}
#services .service1,.service2,.service3,.service4,.service5{
float:left;
background-color:#fff;
border-left:1px solid #e5e5e5;
width:154px;
height:100%;
padding:0 18px 0 19px;
margin-bottom:10px;
}
#services img{
height:100px;
width:100px;
margin:0 auto;
}
#servicesBanner{
clear:both;
width:100%;
height:90px;
margin:15px 0 10px 0;
min-height:100%;
background-color:#e0e0e0;
}
#servicesBanner p{
padding:35px 0 0 8px;
font-size:18px;
color:#ccc;
}
/*Nav Content */
.subNavHeading{
color:#fff;
padding-top:10px;
margin:9px 0 15px 45px;
}
/*Inner Page CSS */
#innerPageLeftCol{
float:right;
width:220px;
min-height:100%;
margin:-10px 0 10px 0;
}
#innerPageContent{
background-color:#fff;
float:left;
width:720px;
min-height:100%;
margin-bottom:10px;
-webkit-border-bottom-right-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-bottomright:2px;
-moz-border-radius-bottomleft:2px;
-webkit-border-top-right-radius:2px;
-webkit-border-top-left-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-topleft:2px;
}
.boxOne{
background:url(../images/sidebarBox.png) no-repeat;
width:220px;
height:100%;
min-height:100%;
margin:10px 0 0 0;
-webkit-border-bottom-right-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-bottomright:2px;
-moz-border-radius-bottomleft:2px;
-webkit-border-top-right-radius:2px;
-webkit-border-top-left-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-topleft:2px;
}
.boxOne li{
margin:5px 0 0 0;
padding-top:5px;
}
.boxOne a{
text-decoration: none;
color:#00afd8;
}
.boxTwo{
background-color:#fff;
width:220px;
height:125px;
margin:15px 0 0 0;
-webkit-border-bottom-right-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-bottomright:2px;
-moz-border-radius-bottomleft:2px;
-webkit-border-top-right-radius:2px;
-webkit-border-top-left-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-topleft:2px;
}
.boxThree{
background-color:#fff;
width:220px;
height:125px;
margin:15px 0 5px 0;
-webkit-border-bottom-right-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-bottomright:2px;
-moz-border-radius-bottomleft:2px;
-webkit-border-top-right-radius:2px;
-webkit-border-top-left-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-topleft:2px;
}
#innerPageContent h1{
margin:30px;
}
#innerPageContent .innerPageSubHeading{
display:block;
font-size:16px;
margin:30px;
width:450px;
}
#innerPage .separator{
margin-top:20px;
padding-top:20px;
}
#innerPageContent p{
margin:30px;
}
#innerPageContent img{
float:right;
width:175px;
height:175px;
margin:30px;
padding:3px;
}
/*Packages Template */
#packageContainer{
width:320px;
list-style:none;
font-size:14px;
color:#000;
margin:0 auto;
}
#packageContainer .leftCol{
width:35%;
float:left;
margin-bottom:10px;
}
#packageContainer .leftCol li{
height:15px;
border-bottom:1px solid #ccc;
border-right:1px solid #ccc;
}
#packageContainer .rightCol{
width:35%;
float:left;
margin-bottom:10px;
}
#packageContainer .rightCol li{
height:15px;
text-indent:8px;
border-bottom:1px solid #ccc;
}
#packageContainer .orderButton{
float:left;
margin:0px 20px 20px 65px;
background:#00afd8;
font-family:Helvetica,arial,sans-serif;
font-size:12px;
color:#fff;
-moz-border-radius:3px;
-webkit-border-radius:3px;
padding:6px 5px;
}
#innerPageProducts{
clear:both;
width:100%;
height:90px;
margin:10px 0 10px 0;
min-height:100%;
background-color:#e0e0e0;
}
#innerPageProducts p{
padding:35px 0 0 8px;
font-size:18px;
color:#ccc;
}
/*Footer */
#nav-footer{
margin: 20px 0 0 0;
padding: 20px 0 20px 20px;
border-top: 1px solid lightGrey;
list-style: none;
font-size: 11px;
}
#nav-footer #col{
margin: 0 auto;
display:inline-block;
width:215px;
}
#nav-footer li{
margin:10px 0 0 -10px;
text-align:left;
}
#nav-footer li a{
text-decoration:none;
}
#nav-footer ul{
list-style:none;
}
#nav-footer .first{
text-decoration:none;
font-weight:bold;
padding-left:30px;
}
My menu seems to align fine in Chrome but when I open it in Firefox 5 I get why?
Answer 1:
I have tested on another computer in firefox 3.6 and get:
HTML:
<nav id="mainMenu">
<ul>
<li class="first">
Domains
<ul>
<li class="first">
Transfer my Domain
</li>
<li class="last">
Get A Domain Name
</li>
</ul>
</li>
</ul>
<ul>
<li class="">
Hosting
<ul>
<li class="first">
Website Hosting
</li>
<li class="">
Hosted CRM
</li>
<li class="last">
Transfer to HostOne
</li>
</ul>
</li>
</ul>
<ul>
<li class="has_current">
Email
<ul>
<li class="first">
Personal E-Mail
</li>
<li class="">
Business Email
</li>
<li class="last current">
Microsoft Hosted Exchange
</li>
</ul>
</li>
</ul>
<ul>
<li class="">
Support
</li>
</ul>
<ul>
<li class="signup last">
SIGN UP
</li>
</ul>
</nav><!-- Main Menu End -->
CSS:
#mainMenu{
height:50px;
margin:0 0 15px 0px;
background-color:#6a6a6a;
-moz-border-radius:3px;
-webkit-border-radius:3px;
}
#mainMenu ul{
display:inline;
-webkit-border-bottom-right-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-bottomright:2px;
-moz-border-radius-bottomleft:2px;
}
#mainMenu ul li{
margin-left:0px;
width:120px;
height:56px;
display:inline;
position:relative;
}
#mainMenu li a {
float:left;
display:block;
text-decoration:none;
width:120px;
height:35px;
font-size:13px;
line-height:45px;
text-align:center;
color:#fff;
text-transform:uppercase;
padding-top:-4px;
margin:0px;
}
#mainMenu li a:hover, #mainMenu li a:active{
text-decoration:none;
background-color:#7a7a7a;
color:#fff;
width:120px;
height:50px;
-webkit-border-top-left-radius:2px;
-webkit-border-bottom-left-radius:2px;
-moz-border-radius-topleft:2px;
-moz-border-radius-topleft:2px;
}
#mainMenu .signup a{
background-color:#69c21c;
height:50px;
margin-left:360px;
-webkit-border-top-right-radius:2px;
-webkit-border-bottom-right-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-bottomright:2px;
}
#mainMenu li .signup a:hover{
background-color:#00afd8;
}
/*mainMenu Sub Menu */
#mainMenu ul li ul{
display:none;
background-color:#7a7a7a;
}
#mainMenu ul li:hover ul{
text-transform:none;
display:block;
position:absolute;
width:135px;
top:50px;
right:-55px;
}
#mainMenu ul li:hover ul a{
float:left;
margin:0 0 0 -35px;
line-height:35px;
width:150px;
height:35px;
border:none;
font-size:12px;
text-align:left;
text-transform:none;
}
#mainMenu ul li ul li a:hover{
width:170px;
height:30px;
font-weight:bold;
margin-left:-35px;
line-height:35px;
}
OK, I didn't see exactly what you were seeing, but I did see that it was a bit messed up in FF. I made some changes to a couple of your CSS statements, and it was working in Chrome and FF. Here is what I did:
Changed "#mainMenu ul li" removed "display: inline;" added "float: left; list-style: none;"
#mainMenu ul li
{
margin-left:0px;
width:120px;
height:56px;
position:relative;
float: left;
list-style: none;
}
Added "#mainMenu .signup" with a "float: right;"
#mainMenu .signup
{
float: right;
}
Removed "margin-left: 360px;" from "#mainMenu .signup a"
#mainMenu .signup a
{
background-color:#69c21c;
height:50px;
-webkit-border-top-right-radius:2px;
-webkit-border-bottom-right-radius:2px;
-moz-border-radius-topright:2px;
-moz-border-radius-bottomright:2px;
}
Now since I am using floats in your nav bar you will probably want to put a clear div after the closing nav tag to clear the floats and start a new div normally.
<div style="clear: both;"> </div>
I am working on a dropdown meenu, which is disappearing in IE 8. Works fine in firefox and chrome, but not in IE8. i googled for two days and made many changes but still not working in IE. Here is the code for CSS.
.dropdownmenu li, .dropdownmenu li ul
{
display: block;display:inline;float:none;
}
dropdownmenu ul:hover , .dropdownmenu ul li:hover
{
display: block;display:inline; float:none;
}
.dropdownmenu{
border:none;
border:0px;
margin:0px;
padding:0px;
font: 37.5% "Lucida Sans Unicode", "Bitstream Vera Sans", "Trebuchet Unicode MS", "Lucida Grande", Verdana, Helvetica, sans-serif;
font-size:14px;
font-weight:bold;
color:#ffffff;
}
.dropdownmenu ul{
background:#333333;
height:35px;
list-style:none;
margin:0;
padding:0;
}
.dropdownmenu li a.top_link span {color:#ffffff;font-size:11px;}
.dropdownmenu li{
color: #FFFFFF;
font-size:11px;
float:left;
padding:0px;
}
.dropdownmenu li a{
background:#333333 url("dropdown/seperator.gif") bottom right no-repeat;
color:#ffffff;
display:block;
font-weight:normal;
line-height:35px;
margin:0px;
padding:0px 11px;
text-align:center;
text-decoration:none;
}
.dropdownmenu li a:hover{
background: #2580a2 url("dropdown/hover.gif") bottom center no-repeat;
color:#FFFFFF;
text-decoration:none;
}
.dropdownmenu li ul{
color:#ffffff;
font-size:10px;
background:#333333;
display:none;
height:auto;
padding:0px;
margin:0px;
border:0px;
position:absolute;
width:auto;
z-index:200;
/*top:1em;
left:0;*/
}
.dropdownmenu li:hover ul{
display:block;
float:left;
}
.dropdownmenu li li {
background:url('dropdown/sub_sep.gif') bottom left no-repeat;
display:block;
float:none;
margin:0px;
padding:0px;
width:auto;
}
.dropdownmenu li ul a{
display:block;
height:35px;
font-size:12px;
color:#ffffff;
font-style:normal;
margin:0px;
padding:0px 10px 0px 17px;
text-align:left;
}
.dropdownmenu li ulli a:hover{
display:block;
background:#2580a2;
color:#ffffff;
text-decoration:none;
}
Here is the php code, I have used <?include ('dropdown.php')?> on my site to include this in the CMS built website.
<link rel="stylesheet" href="dropdown/dropdown3.css" type="text/css" />
<ul class="dropdownmenu">
<li ><span>Home & Garden <img src="dropdown/down.gif"></span>
<ul class="sub">
<li>ArtWork</li>
<li>Bedding & Bath</li>
<li>Kitchen & Dining</li>
<li>Patio, Lawn & Garden</li>
<li>Pet Supplies</li>
<li>Sewing, Craft & Hobbies</li>
<li>Vacuum, Cleaning & Storage </li>
</ul>
</li>
</ul>
What else can i do to fix it in IE?
Also, when the dropdown menu is hovered, it shows a background color of #2580a2, which can be seen at .dropdownmenu li a:hover This particular thing is not being shown in chrome. What could be the reason?
Using Internet Explorer Compatibility View on that website may help it display properly. Try it.
I'm using jQuery Dropdown for this with no errors at any browser.
If your menu will work well Explorer Compatibility View as "Sagotharan" suggested you can override IE rendering engine by setting it to render as IE7 always, like so
<meta http-equiv="X-UA-Compatible" content="IE=7" />