Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE6 doesn't respect width: 100% inside an absolute box

Status
Not open for further replies.

bpw89

Programmer
Dec 17, 2006
11
0
0
US
I am trying to modify a basic horizontal CSS drop down menu (found at to match the color scheme of the website I'm developing.

The problem is in IE6, where the second layer of the menu stretches outside of its container, even though it is set with width: 100%. Here a live demo (view in IE7,8, or FF to see desired behavior): Also, the relevant code is below:

Does anyone know what causes this or how I can fix it? Thanks!

<ul id="navbar">
<li><a href="#">Home</a></li>
<li><a href="#">Exhibits and Events</a>
<ul>
<li><a href="#">Current Exhibit</a></li>
<li><a href="#">Coming Exhibit</a></li>
<li><a href="#">Events</a></li>
</ul>
</li>
..Etcetera...
</ul>

#navbar {
float:right;
position: relative; }
#navbar li ul {
display: none; }
#navbar li:hover ul, #navbar li.hover ul {
display: block;
position: absolute;
top: 100%;
left: 0;
width: 100%;}

Bryon W - --
Visit my latest website: AwfulDeals.com.
Sign up for the Awful Newsletter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top