I have a 3-level drop down menu and I have 2 issues:
Issue 1: Partly solved. See my answer below I would like to underline the active selected tag the same blue underline color as when hovering over the other tabs... So if the home page tab is active, it should underline(border-bottom) the home tab until another one is selected...
Issue 2: When hovering over the any of the sub-menu items, it underlines(border-bottom) it like it should, but the underline(border-bottom) is longer than the background of the parent li tag...How do I line them up?
Also, how can I keep 'Services' underlined when I am hovering over its sub-menu items?
HERE IS MY FIDDLE: http://jsfiddle.net/6aT9W/4/
HTML:
<div id="page-wrap">
<ul class="dropdown">
<li><a class="first" href="#">Home</a>
</li>
<li><a class="first" href="#">About Us</a>
</li>
<li><a class="first" href="#">Services</a>
<ul>
<li> <a href="#">Supply & Distribution</a>
<ul>
<li><a href="#">Supply and distribution of industrial and raw materials including timber, machinery, equipment, fuel, technology and other resource.</a>
</li>
<li><a href="#">Supply of technological products including Information Technology and telecommunication equipment with integrated solutions.</a>
</li>
</ul>
</li>
<li> <a href="#">Procurement & Product Sourcing</a>
<ul>
<li><a href="#">Sourcing of industrial products for the industrial, energy and mining sectors.</a>
</li>
</ul>
</li>
<li> <a href="#">Sales and Marketing</a>
<ul>
<li><a href="#">Sales, marketing and promotions including brand development strategies, research, demographic targeting.</a>
</li>
</ul>
</li>
</ul>
</li>
<li><a class="first" href="#">Products</a>
<ul>
<li><a>Caskets</a>
</li>
</ul>
</li>
</ul>
</div>
CSS:
* {
margin: 0;
padding: 0;
}
#page-wrap {
width: 800px;
margin: 25px auto;
}
a {
text-decoration: none;
}
ul {
list-style: none;
}
p {
margin: 15px 0;
}
/*
BODY
*/
#page-wrap {
margin: 0 auto;
width: 940px;
height: 86px;
border-bottom: 1px solid #bbb;
}
/*
LEVEL ONE
*/
ul.dropdown {
position: relative;
}
ul.dropdown li {
font-weight: bold;
float: left;
zoom: 1;
}
ul.dropdown a:hover {
color: #000;
}
ul.dropdown li.active a {
color: #ffa500;
}
ul.dropdown li a {
display: block;
padding: 29px 8px;
color: #222;
font- size: 18px;
font-family:'Open Sans', Sans-Serif;
border-bottom: 6px solid transparent;
}
ul.dropdown li:last-child a {
border-right: none;
}
/* Doesn't work in IE */
ul.dropdown li.hover, ul.dropdown li:hover {
background: #f1f1f1;
color: black;
position: relative;
}
ul.dropdown li.hover > a, ul.dropdown li > a:hover {
color: black;
border-bottom: 6px solid #003399;
}
/*
LEVEL TWO
*/
ul.dropdown ul {
width: 230px;
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
}
ul.dropdown ul li {
background: #fafafa;
font-weight: normal;
color: #000;
float: none;
border-bottom: 1px solid #ccc;
}
/* IE 6 & 7 Needs Inline Block */
ul.dropdown ul li a {
border-bottom: 6px solid transparent;
border-right: none;
width: 100%;
display: inline-block;
padding: 8px 8px;
font-size: 14px;
}
/*
LEVEL THREE
*/
ul.dropdown ul ul {
left: 100%;
top: 0;
}
ul.dropdown li:hover > ul {
visibility: visible;
}
Thank You