hey folks....... have created a horizontal drop down menu for my site. All seems fine except the drop downs disappear when im viewing it in IE. i have used a bug fix which looks like this. * html ul li { float: left; } * html ul li a { height: 1%; } Code (markup): however it is still very "buggy" in IE. any ideas why this is happening? is CSS the best way to create a drop down menu? regards.........
I need to see your full HTML and CSS code, but I have a feeling that you're being bothered by IE 6 and not IE 7. And yes, CSS is the best way to create a dropdown menu, as is shown here: http://www.htmldog.com/articles/suckerfish/dropdowns/
Also, you are likely to have problems in IE with the float being on the LI - that's the LAST place you want it as floating LI's have wierd behaviors all around. The LI should probably be inline, with the anchor itself floating... in which case you might not even NEED the haslayout.
Huh? I've heard just the opposite-- when people are having problems and using display: inline, they're told to remove that and float the li's. I've never heard of floating the anchors. What does that give you compared to floating the li's?
less code, fewer chances of tripping hasLayout, and it also makes the anchor act like a block-level element that can also wrap around its content rather than take up every possible centimeter of real estate
Dan, can you point me to a menu that's using the anchor float instead of the li float? I usually display:block my anchors anyway so the hover fills the whole li (and the clickable area is full, and more control over padding/spacing...), so that effect I'm happy with.
I've tried making one that uses the float on the anchor with the list item inline before, but haven't had much luck. I can probably give it another spin though if you want.