I had some help here getting multi-lined text in my main nav to center vertically but I'm having trouble getting the text in the sub nav to do the same. I've made a bit of a mess.
http://codepen.io/Compton/pen/icBDw/
#nav-wrap {
width:100%;
height:100px;
font-weight:500;padding: 0;
left:0;
font-family: 'Raleway', Arial, sans-serif;
}
#nav-wrap ul {
list-style-type: none;
margin: 0;
padding:0;
text-transform: uppercase;
}
#nav-wrap ul li {
width:14.275%; /* ~(100/7) */
display:block;
float:left;
text-align:center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#nav-wrap ul li a {
width:100%;
display: block;
height: 100%;
position: relative;
color:#FFFFFF !important;
text-decoration:none;
}
#nav-wrap ul li + li {
border-left: 1px #fff solid;
}
#nav-wrap ul li span {
display: inline-block;
vertical-align: middle;
height: 100px;
font-size:1.45em;
text-align: center;
padding: 0 5% 0 5%; /* was 0 20px */
line-height: 100px;
}
#nav-wrap ul li.yellow-facebook {
width:14.275%;
}
#nav-wrap ul li.yellow-facebook a {
background-size:130px 26px; /* > 25px */
}
#nav-wrap .doubleLine {
display: table-cell;
line-height: 1.2em;
width:65.275%;
}
li .subnav {
display: none;
position: absolute;
clear: both;
margin-left: 0;
/*font-size:0.9em;*/
}
.subnav ul {
margin-left: 0;
float:left;
padding:0;
width:100%;
}
.subnav ul li {
margin: 0 0 0 0;
height:42px;
}
.subnav ul li a {
padding: 5px 0 5px 0;/*
background-image: url(../images/submenu-background-divider.png);
background-repeat:no-repeat;
background-position:left;*/
}
.subnav ul li span {
display: inline-block !important;
vertical-align: middle !important;
height: 40px !important;
text-align: center !important;
padding: 0 0 0 0 !important; /* was 0 20px */
line-height: 1.1em !important;
font-size:0.9em !important;
}
.subnavul li span .doubleLine {
display: table-cell !important;
width:65.275% !important;
}
.subnav {
width:100%;
padding: 0;
margin: 0.05% 0 0 0;
}
#nav-wrap ul li.orange a {
background-color:#f37028;
}
#nav-wrap ul li.orange a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.red a {
background-color:#ed1b24;
}
#nav-wrap ul li.red a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.pink a {
background-color:#e54198;
}
#nav-wrap ul li.pink a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.purple a {
background-color:#6b439c;
}
#nav-wrap ul li.purple a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.blue a {
background-color:#0193cf;
}
#nav-wrap ul li.blue a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.green a {
background-color:#80c02c;
}
#nav-wrap ul li.green a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.yellow-facebook a {
background-color:#fff300;
background-image:url(../images/social-media/facebook-text.png);
background-repeat:no-repeat;
background-position:center;
}
#nav-wrap ul li.yellow-facebook a:hover {
color: #231f20;
background-image:url(../images/social-media/facebook-text_over.png);
}
.subnav ul li a:link, a:active, a:visited {
text-decoration:none;
}
.subnav ul li a:hover {
color:#000;
text-decoration:none;
}
li:hover > .subnav {display:inline-block; left:0;}
Adding display:table-cell; for the following like below
.subnav ul li span {
display: table-cell !important;
vertical-align: middle !important;
height: 40px !important;
text-align: center !important;
padding: 0 0 0 0 !important; /* was 0 20px */
line-height: 1.1em !important;
font-size:0.9em !important;
}
fixes the issue
Related
Trying to get the words in my navigation bar to center. I have tried a bunch of different configs that I found online and so far no luck.
Also, is there anything I can do to make the navigation bar appear cleaner and more professional?
Thank you in advance
<div class="nav-container clearfix">
<ul id="nav">
<li class="first"><span>Home</li>
<li><span>Why Soy?</li>
<li><span>Candle Sold, Tree Planted</li>
<li><span>Build-a-Candle</li>
<li><span>Contact Us</li>
<li><a class="category" href="<?php echo Mage::getBaseUrl(); ?>all-products">
<span>Buy Products</span>
<ul class="level0">
<?php echo $_menu ?>
</ul>
</a>
</li>
</ul>
/*** CLEARFIX ******/
.clearfix:before,
.clearfix:after {
content: "";
display: table;
clear: both
}
/********** < Navigation */
.nav-container {clear: both; width:100%; float: left; text-align: center; margin: 10px 0px 10px; text-transform: uppercase; font-weight: bold; display: inline; background:#d4dadd !important; box-shadow: 10px 10px 5px #888888 !important; }
#nav { margin:0 auto; padding:0; font-size:12px; }
/* All Levels */ /* Style consistent throughout all nav levels */
#nav li {
display: inline-block;
padding: 5px;
margin: 5px;
border-right: 1px solid #000;
list-style: none;
vertical-align: top;
height: 50px;
position:relative;
}
#nav li.over { z-index:998; background-color: #b3bec3; }
#nav a,
#nav a:hover { display:block; line-height:1.3em; text-decoration:none; padding: 10px;
text-align: center; }
#nav span { display:block; cursor:pointer; }
#nav li ul span {white-space:normal; }
#nav ul li.parent a {}
#nav ul li.parent li a { background-image:none; }
#nav a.category span { background: url(../images/nav-category.gif) no-repeat center right; padding-right: 20px; }
/* 0 Level */
#nav li.active a { color:#2882ce; }
#nav a { font-size: 115%; color:#303030; }
#nav li.last a { padding-right: 0px !important;}
#nav li.over a,
#nav a:hover { color:#2882ce; }
/* 1st Level */
#nav ul li,
#nav ul li.active { float:none; margin:0; padding-bottom:1px; background:#d4dadd; }
#nav ul li.last { background:#d4dadd; padding-bottom:0; }
#nav ul a,
#nav ul a:hover { float:none; padding:0; background:none; }
#nav ul li a { font-size: 100% !important; font-weight:normal !important; }
/* 2nd Level */
#nav ul,
#nav div { position:absolute; width:15em; top:27px; left:-10000px; border:1px solid #899ba5; }
#nav div ul { position:static; width:auto; border:none; }
/* 3rd+ Level */
#nav ul ul,
#nav ul div { top:5px; }
#nav ul li a { background:#d4dadd; }
#nav ul li a:hover { background:#b3bec3; }
#nav ul li a,
#nav ul li a:hover { color:#2f2f2f !important; }
#nav ul span,
#nav ul li.last li span { padding:3px 15px 4px 15px; }
/* Show menu */
#nav li ul.shown-sub,
#nav li div.shown-sub { left:0; z-index:999; }
#nav li .shown-sub ul.shown-sub,
#nav li .shown-sub li div.shown-sub { left:100px; }
<div class="nav-container clearfix">
<ul id="nav">
<li class="first"><span>Home</li>
<li><span>Why Soy?</li>
<li><span>Candle Sold, Tree Planted</li>
<li><span>Build-a-Candle</li>
<li><span>Contact Us</li>
<li><a class="category" href="<?php echo Mage::getBaseUrl(); ?>all-products">
<span>Buy Products</span>
<ul class="level0">
<?php echo $_menu ?>
</ul>
</a>
</li>
</ul>
I changed your code a bit, here is a snippet below, to see this snippet working click Full Page button.
UPDATED snippet based on OP's Comments to answer.
/*** CLEARFIX ******/
.clearfix:before,
.clearfix:after {
content: "";
display: table;
clear: both
}
/********** < Navigation */
.nav-container {
clear: both;
width: 100%;
float: left;
margin: 10px 0px 10px;
text-transform: uppercase;
font-weight: bold;
display: inline;
background: #ecf3f6 !important;
box-shadow: 10px 10px 5px #888888 !important;
}
#nav {
margin: 0 auto;
padding: 0;
font-size: 12px;
}
/* All Levels */
/* Style consistent throughout all nav levels */
#nav li {
display: inline-block;
margin: 5px 0;
border-right: 1px solid #000;
list-style: none;
vertical-align: top;
height: 70px;
width:16.3%
}
#nav li:last-child {
border-right: 0
}
#nav li.over {
z-index: 998;
background-color: #d4dadd;
}
#nav a,
#nav a:hover {
display: block;
line-height: 1.3em;
text-decoration: none;
padding: 10px;
text-align: center
}
#nav span {
display: block;
cursor: pointer
}
#nav li ul span {
white-space: normal;
}
#nav ul li.parent a {} #nav ul li.parent li a {
background-image: none;
}
#nav a.category span {
background: url(../images/nav-category.gif) no-repeat center right;
padding-right: 20px;
}
/* 0 Level */
#nav li.active a {
color: #2882ce;
}
#nav a {
font-size: 115%;
color: #303030;
}
#nav li.last a {
padding-right: 0px !important;
}
#nav li.over a,
#nav a:hover {
color: #2882ce;
}
/* 1st Level */
#nav ul li,
#nav ul li.active {
float: none;
margin: 0;
padding-bottom: 1px;
background: #ecf3f6;
}
#nav ul li.last {
background: #ecf3f6;
padding-bottom: 0;
}
#nav ul a,
#nav ul a:hover {
float: none;
padding: 0;
background: none;
}
#nav ul li a {
font-size: 100% !important;
font-weight: normal !important;
}
/* 2nd Level */
#nav ul,
#nav div {
position: absolute;
width: 15em;
top: 27px;
left: -10000px;
border: 1px solid #899ba5;
}
#nav div ul {
position: static;
width: auto;
border: none;
}
/* 3rd+ Level */
#nav ul ul,
#nav ul div {
top: 5px;
}
#nav ul li a {
background: #ecf3f6;
}
#nav ul li a:hover {
background: #d5e4eb;
}
#nav ul li a,
#nav ul li a:hover {
color: #2f2f2f !important;
}
#nav ul span,
#nav ul li.last li span {
padding: 3px 15px 4px 15px;
}
/* Show menu */
#nav li ul.shown-sub,
#nav li div.shown-sub {
left: 0;
z-index: 999;
}
#nav li .shown-sub ul.shown-sub,
#nav li .shown-sub li div.shown-sub {
left: 100px;
}
<div class="nav-container clearfix">
<ul id="nav">
<li class="first"><span>Home</span>
</li>
<li>whysoy<span>Why Soy?</span>
</li>
<li>plantatree<span>Candle Sold, Tree Planted</span>
</li>
<li><span>Build-a-Candle</span>
</li>
<li><span>Contact Us</span>
</li>
<li><a class="category" href=""><span>Buy Products</span>
<ul class="level0">
</ul>
</a>
</li>
</ul>
</div>
UPDATE #3 (with new info from OP)
in order to achieve what you want, just make this changes below on your CSS:
.nav-container {
background: none repeat scroll 0 0 #d4dadd !important;
box-shadow: 10px 10px 5px #888888 !important;
float: left;
font-size: 0;
font-weight: bold;
margin: 10px 0;
text-align: center;
text-transform: uppercase;
width: 100%;
}
#nav li {
border-right: 1px solid #000;
display: inline-block;
font-size: 12px;
height: 50px;
list-style: none outside none;
margin: 5px 0;
padding: 5px;
position: relative;
vertical-align: top;
width: 15%;
}
#nav ul li, #nav ul li.active {
background: none repeat scroll 0 0 #d4dadd;
border-right: 0 none;
display: block;
float: none;
margin: 0;
width: 100%;
}
/*you may delete this:
#nav ul li.last {
}*/
I have designed a menu.
HTML code is give
<div class="navi">
<ul class="menu">
<li class="current_page_item">Women</li>
<li>Men</li>
<li>Junior</li>
<li>Accessories</li>
<li>Collections
<ul class='children'>
<li>Year</li>
<li>2014
<ul class='children'>
<li>SUMMER</li>
<li>AUTUMN</li>
<li>WINTER</li>
<li>SPRING</li>
</ul>
</li>
<li>2013</li>
</ul>
</li>
<li>Sale</li>
<li class="last"><a href='#'>MY ACCOUNT</a>
</li>
</ul>
<br style="clear:both;" />
</div>
The CSS is give bellow
.navi {
width:1000px;
margin:0 auto;
border-bottom:5px solid #000;
height:50px;
}
.menu {
width:1000px;
margin:0 auto;
}
.menu, .menu ul {
display: block;
list-style-type: none;
margin: 0;
padding: 0;
}
.menu li {
border: 0 none;
display: block;
float: left;
margin: 0;
padding: 0;
position: relative;
z-index: 5;
}
.menu li:hover {
white-space: normal;
z-index: 10000;
}
.menu li li {
float: none;
}
.menu ul {
left: 0;
position: absolute;
top: 0;
visibility: hidden;
z-index: 10;
}
.menu li:hover > ul {
top: 100%;
visibility: visible;
}
.menu li li:hover > ul {
left: 100%;
top: 0;
}
.menu:after, .menu ul:after {
clear: both;
content: ".";
display: block;
height: 0;
overflow: hidden;
visibility: hidden;
}
.menu, .menu ul {
min-height: 0;
}
.menu ul {
margin: -10px 0 0 -30px;
padding: 10px 30px 30px;
}
.menu ul ul {
margin: -30px 0 0 -10px;
padding: 30px 30px 30px 10px;
}
.menu ul li a:hover, .menu li li a:hover {
color: #484848;
text-decoration: none;
}
.menu ul {
min-width: 15em;
width: auto;
}
.menu a.arrow
{
background: url(arrow.gif) no-repeat right center;
}
.menu ul a.arrow
{
background: url(right.gif) no-repeat 97% center;
}
.menu .menuRight
{
float: right;
margin-right: 0px;
}
.menu a {
font-family:Harvest;
color: #314350;
display: block;
height:55px;
line-height:55px;
margin: 0 0px 0 0;
padding: 0 1em;
position: relative;
text-decoration: none;
font-size:18px;
}
.menu a:hover {
background-color: #1c2b36;
color: #ffffff;
box-shadow:#000 0 0 0, inset #3cc0c4 0 -5px 0;
}
.menu .current_page_item a {
background-color:#1c2b36;
color: #ffffff;
box-shadow:#000 0 0 0, inset #3cc0c4 0 -5px 0;
}
.menu li li {
-moz-border-bottom-colors: none;
-moz-border-left-colors: none;
-moz-border-right-colors: none;
-moz-border-top-colors: none;
background: none repeat scroll 0 0 #FFFFFF;
border-color: -moz-use-text-color #B2B2B2 #B2B2B2;
border-image: none;
border-right: 1px solid #B2B2B2;
border-style: none solid solid;
border-width: medium 1px 1px;
color: #444444;
filter: none;
width: auto;
}
.menu li li a {
background-position: 50% 50%;
background-repeat: no-repeat;
border: medium none;
color: #444444;
font-size: 12px;
font-weight: 400;
height: 20px;
line-height: 20px;
padding: 5px 10px;
text-shadow: none;
white-space: nowrap;
}
.menu li li a:hover {
background:#E5E4E4;
border: medium none;
color: #333;
filter: none;
}
.menu ul > li + li {
border-top: 0 none;
}
.menu li li:hover > ul {
left: 100%;
top: 0;
}
.menu > li:first-child > a {
border-left: medium none;
}
.menu > li:first-child > a, .menu li + li + li li:first-child > a {
}
.menu ul.children a, .menu .current_page_ancestor, .menu .current_page_ancestor ul a {
background: none;
filter: none;
}
.menu ul.children a{background:url(images/arrow.png) no-repeat 93% 70%;}
.menu ul.children a:hover{background:url(images/arrow.png) no-repeat 93% 70% #999;}
ul.sub-menu .current_page_item a {
background:none;
}
.footer-box-last {
width:420px;
float:left;
background:#b6c2c9;
height:150px;
}
.footer_outer {
background:url(mail-icon.png) repeat:none;
width:400px;
border-radius:5px;
margin:5px;
background-color:#fff;
}
.footer-box-last h2 {
color:#e8ecee;
font-size:20px;
font-weight:lighter;
margin:15px 15px 15px 7px;
}
.footer-box-last label {
color:#9B9B9A;
font-family:Arial, Helvetica, sans-serif;
font-size:13px;
}
.icon {
width:20px;
height:30px;
float:left;
margin:11px 0 0 5px;
}
.field-2 {
border: medium none;
width:220px;
height:30px;
border-radius:5px;
border:none;
color:#4c565f;
margin:5px;
}
.form_btn {
background-color:#3bc0c3;
color:#ffffff;
float:right;
border-radius:5px;
height:34px;
width:120px;
border:none;
margin:4px;
}
.last {
float:right;
padding-left:60px;
font-style:italic;
}
</style>
I want to move the last li item to the left. then it will look like this n pic
I need a space between SALES and MY ACCOUNT
please help me in this.
Thank you in advance
Try adding this:
.menu li.last {
float:right;
}
You had the right CSS in your code (.last), but you need to give it more authority as it is being overwritten by #menu li code. So on your last declaration change it to ".menu li.last" instead of ".last"
Try This
.menu li.last {
float:right;
}
OR
.menu li:last-child {
float:right;
}
Try this
.menu li:last-child {
float:right;
}
Try this:
.last{
position: relative;
left: -50px;
}
I'm not sure if this can be done that way it was built but I'd like to add a transition effect to my dropdown. Anything that would make it seem less choppy. SLide, fade etc. Codepen below.
<div id="nav-wrap">
<ul>
<li id="link-one" class="orange">
<span>Test</span>
<div class="subnav">
<ul>
<li>Test</li>
<li>Test</li>
<li>Test</li>
<li>Test</li>
<li>Test</li>
<li>Test</li>
</ul>
</div><!-- /.subnav -->
</li>
<li class="red"><span>Test</span></li>
<li class="pink"><span>Test</span></li>
<li class="purple"><span>Test</span></li>
<li class="blue"><span>Test</span></li>
<li class="green"><span>Test</span></li>
<li class="yellow-facebook"><span></span></li>
</ul>
</div> <!-- nav-wrap -->
#nav-wrap .doubleLine {
display: table-cell;
line-height: 1.2em;
width:65.275%;
}
#nav-wrap {
width:100%;
height:100px;
font-weight:500;
padding: 0;
left:0;
font-family: 'Raleway', Arial, sans-serif;
z-index:100;
float:left;
}
#nav-wrap ul {
list-style-type: none;
margin: 0;
padding:0;
text-transform: uppercase;
}
#nav-wrap ul li {
width:14.275%; /* ~(100/7) */
display:block;
float:left;
text-align:center;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
#nav-wrap ul li + li {
border-left: 1px #fff solid !important;
}
#nav-wrap ul li a {
width:100%;
display: block;
height: 100%;
position: relative;
color:#FFFFFF !important;
text-decoration:none;
}
#nav-wrap ul li span {
display: inline-block;
vertical-align: middle;
height: 100px;
font-size:1.45em;
text-align: center;
padding: 0 5% 0 5%; /* was 0 20px */
line-height: 100px;
}
#nav-wrap ul li.yellow-facebook {
width:14.275%;
}
#nav-wrap ul li.yellow-facebook a {
background-size:130px 26px; /* > 25px */
}
li .subnav {
display: none;
/*position: absolute; */
clear: both;
margin-left: 0;
font-size:0.9em;
}
.subnav ul {
margin-left: 0;
float:left;
padding:0;
width:100%;
}
.subnav ul li {
margin: 0 0 0 0;
width:100% !important;
height:23px;
float:none !important;
}
.subnav ul li a {
padding: 10px 0 3px 0;
/*background-image: url(../images/submenu-background-divider.png);
background-repeat:no-repeat;
background-position:left;*/
}
#nav-wrap .subnav ul li + li {
border-left: none !important;
}
.subnav {
width:100%;
padding: 0;
margin: 0.05% 0 0 0;
border-top:#FFF 1px solid;
}
.subnav ul li a:link, a:active, a:visited {
text-decoration:none;
}
.subnav ul li a:hover {
color:#000;
text-decoration:none;
}
li:hover > .subnav {display:inline-block; left:0;}
#nav-wrap ul li.orange a {
background-color:#f37028;
}
#nav-wrap ul li.orange a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.red a {
background-color:#ed1b24;
}
#nav-wrap ul li.red a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.pink a {
background-color:#e54198;
}
#nav-wrap ul li.pink a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.purple a {
background-color:#6b439c;
}
#nav-wrap ul li.purple a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.blue a {
background-color:#0193cf;
}
#nav-wrap ul li.blue a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.green a {
background-color:#80c02c;
}
#nav-wrap ul li.green a:hover {
color: #231f20 !important;
}
#nav-wrap ul li.yellow-facebook a {
background-color:#fff300;
background-image:url(../images/social-media/facebook-text.png);
background-repeat:no-repeat;
background-position:center;
}
#nav-wrap ul li.yellow-facebook a:hover {
color: #231f20;
background-image:url(../images/social-media/facebook-text_over.png);
}
http://codepen.io/Compton/pen/jLGyo/
You can try a CSS3 transition, only you would have to use opacity instead of display none.
add this
li:hover > .subnav {
display:inline-block;
left:0;
-webkit-transition: all 0.4s ease-in;
-moz-transition: all 0.4s ease-in;
-o-transition: all 0.4s ease-in;
transition: all 0.4s ease-in;
opacity:1.0;
}
and change the display none to this:
li .subnav {
opacity:0;
/*position: absolute; */
clear: both;
margin-left: 0;
font-size:0.9em;
}
Jquery can do some sliding if you'd rather, but this is a little simpler to set up, you can also adjust the height to make it slide down if youd rather that instead of a fade in.
Put this to the animated element CSS:
transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
It basically fools browser that the transition or animation is 3D and enables GPU acceleration and disables two-sided planes in webkit based browsers.
So I have picked a base theme in Weebly and have been completely changing it with my own CSS and HTML. I am trying to modify a horizontal navigation bar. The bar itself is centered, but the text inside the bar listing the pages (home, videos, design, resume, etc.) is not. Below I have included the CSS responsible for the navigation bar. Thank you for your help!
#nav-wrap .container {
clear: both;
overflow: hidden;
position: relative;
}
#nav-wrap .container {
background:url(nav-bg-light.jpg) repeat-x top;
height:45px;
}
#nav-wrap .container ul {
list-style: none;
}
#nav-wrap .container ul li {
list-style: none;
float: left;
background:url(nav-saperator-light.jpg) no-repeat right;
padding-right:2px;
}
#nav-wrap .container ul > li:first-child a,
#nav-wrap .container ul > li:first-child a:hover,
#nav-wrap .container ul span:first-child li a,
#nav-wrap .container ul span:first-child li a:hover{
border-radius:5px 0px 0px 5px;
}
#nav-wrap .container ul li a {
float: left;
display: block;
font-family: 'Rosario', sans-serif;
color: #262626;
padding: 0px 30px;
border: 0;
outline: 0;
list-style-type: none;
font-size: 14px;
line-height:45px;
text-shadow: 0px -1px 0px #fff;
}
#nav-wrap .container ul li:hover {
background:url(nav-saperator-hover-light.jpg) no-repeat right;
}
#nav-wrap .container ul li a:hover {
background:url(nav-bg-hover-light.jpg) repeat-x top ;
}
#nav-wrap .container ul li:active {
background:url(nav-saperator-active-light.jpg) no-repeat right;
}
#nav-wrap .container ul li a:active {
background:url(nav-bg-active-light.jpg) repeat-x top ;
}
#nav-wrap .container ul li#active {
background:url(nav-saperator-current-light.jpg) no-repeat right;
}
#nav-wrap .container ul li#active a {
background:url(nav-bg-current-light.jpg) repeat-x top ;
}
I think you just need to add this:
#nav-wrap .container ul li a {
text-align:center;
}
#nav-wrap .container ul li a { ... }
I think this is where you want the text to be centered, it should be easy to do with
text-align:center;
I have a menu using SuperFish but the last 2 submenu's do not align up properly.
Here is my jsfiddle: http://jsfiddle.net/uP4bY/4/
My CSS looks like this:
/* Header/Navigation */
div#Nav {
background:transparent url(../Images/nav_Bg.png) no-repeat scroll top left;
height:70px;
width:980px;
margin:0 auto;
display:block;
position:relative;
z-index:2;
}
/*Level 1 or Parent / Destination*/
div#Nav ul {
padding-top:9px;
display:inline;
list-style-type:none;
margin:0;
}
div#Nav ul li {
background:transparent url(../Images/nav_li_Separator.png) no-repeat scroll center left;
padding-left:8px;
margin-left:8px;
display:inline;
position:relative;
}
div#Nav ul li.First {
background:none;
margin:0;
padding:0;
}
/*Level 2 Treks*/
div#Nav ul li ul {
left:10px;
position:absolute;
top:26px;
padding:0 !important;
z-index:100;
height:500px;
float:left;
list-style:outside;
width:auto;
}
/*Level 3 Everest Region*/
div#Nav ul li ul li ul {
float: left;
height: 500px;
left: 50px;
list-style: disc outside none;
padding: 0 !important;
position: absolute;
top: 30px;
width: auto;
z-index: 100;
}
/*Level 5 Everest Base Camp*/
div#Nav ul ul ul ul ul {
float: left;
height: 500px;
left: 50px;
list-style: disc outside none;
padding: 0 !important;
position: absolute;
top: 60px;
width: auto;
z-index: 100;
}
div#Nav ul li ul li {
border-top:1px solid #2f3b48;
border-right:1px solid #384857;
border-bottom:1px solid #384857;
height:24px;
display:block;
padding:5px 15px 0;
width:150px;
/*width:150px;*/
border-left:1px solid #384857;
margin:0 !important;
background:transparent url(http://www.kenticotemplates.net/themeforest/DreamTravel/Images/Nav_ul_li_Bg.png) repeat scroll top left !important;
}
div#Nav a, div#Nav a:link, div#Nav a:visited {
color:#7f8b98;
}
div#Nav a:hover, div#Nav a.selected {
color:#96b2cb !important;
text-decoration:none;
}
div#Nav ul#Links, div#Nav ul.nav {
float:left;
text-transform:uppercase;
}
div#Nav ul.Lang {
float:right;
}
div#Nav ul li {
float:left;
}
I am pretty certain i need to style the last ul li but when i do this it moves the previous ul li.
UPDATE: it should look like this minus the white space!
http://i48.tinypic.com/1zfpxqf.png
Solution of problem is her in fiddle : http://jsfiddle.net/7mvuw/
Demo: http://jsfiddle.net/7mvuw/embedded/result/
Note: I have changed the looks and feel but html structure is same, looks and feel for demo purpose you can adjust as per your requirement.
#access {
background: #000;
display: block;
float: left;
margin: 0 auto;
width: 940px;
}
#access .menu-header,
div.menu {
font-size: 13px;
margin-left: 12px;
width: 928px;
}
#access .menu-header ul,
div.menu ul {
list-style: none;
margin: 0;
}
#access .menu-header li,
div.menu li {
float: left;
position: relative;
}
#access a {
color: #aaa;
display: block;
line-height: 38px;
padding: 0 10px;
text-decoration: none;
}
#access ul ul {
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
display: none;
position: absolute;
top: 38px;
left: 0;
float: left;
width: 180px;
z-index: 99999;
padding-left:0;
}
#access ul ul li {
min-width: 180px;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #333;
line-height: 1em;
padding: 10px;
width: 160px;
height: auto;
}
#access li:hover > a,
#access ul ul :hover > a {
background: #333;
color: #fff;
}
#access ul li:hover > ul {
display: block;
}
#access ul li.current_page_item > a,
#access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a,
#access ul li.current-menu-parent > a {
color: #fff;
}