I’m making a navigation where the children will be showed in a different box, much like http://www.boffi.com/EN/Collections/bathrooms/b14.aspx . I managed to separate the child using absolute positioning, but can’t get the child elements background to have a 100% height. it’s a list element, so if I put height: 100% , the bottom two main navigation elements dissapears. Please help! Here’s my html:
<ul id="mainmenu">
<li id="liHome" class="active">
<a href="#item-x1y1" class="panel" rel="none" id="Home">Home</a>
</li>
<li id="liServices" class=" ">
<a href="#item-x1y2" class="panel" rel="SubMenuY2" id="Services">Services</a>
<div class="child">
<ul style="" id="SubMenuY2" class="submenu">
<li><a href="#">Sub-item 1</a></li>
<li><a href="#">Sub-item 2</a></li>
</ul>
</div>
</li>
<li id="liEnvironment">
<a href="#item-x1y3" class="panel" rel="none" id="Environment">Environment</a>
</li>
<li id="liCareer">
<a href="#item-x1y4" class="panel" rel="none" id="Career">Career</a>
</li>
<li id="liContact">
<a href="#item-x1y5" class="panel" rel="none" id="Contact">Contact</a>
</li>
</ul>
and the css
body, html{
height:100%;
}
#mainmenu{
background:black;
color: white;
width:130px;
position:relative;
top:0;
height:100%
}
#mainmenu li a {
color:white;
}
ul.submenu{
position:absolute;
background:blue;
width:130px;
}
div.child{
position:relative;
margin-left:130px;
}
Thanks a lot for the help.
I simplified your code a little.. well I actually just removed the
divwithclass="child", as you don’t really need it.Then, all I did was this:
Take a look at the fiddle: http://jsfiddle.net/joplomacedo/rqqju/
Was this what you were looking for?