For whatever reason Firefox 4 is displaying the sub-menu links totally off, whereas it works fine in Chrome and IE9.
See attached.
Thanks.
For whatever reason Firefox 4 is displaying the sub-menu links totally off, whereas it works fine in Chrome and IE9.
See attached.
Thanks.
Brief summary: ’s suggestion to make the menu wrapper an actual floated element fixed the Firefox-only misplacement that reported. Chrome and IE sometimes tolerate missing layout contexts; Firefox can behave differently. The root causes are usually an absent containing block for absolutely positioned submenus or differences in how browsers create block formatting contexts.
Why this happens and how to debug:
Safer, cross‑browser patterns (examples to try):
/* parent that should contain the submenu */
.menu-item {
position: relative;
}
/* submenu positioned relative to that parent */
.menu-item .submenu {
position: absolute;
left: 0;
top: 100%;
z-index: 1000;
} If you need the wrapper to also clear children or form a block formatting context without using a floated layout, use a clearfix:
.clearfix::after {
content: "";
display: table;
clear: both;
} Quick checklist:
This explains why the float fix worked and gives alternative, more robust approaches for consistent behavior across browsers.
Jump to Post— ko ko 97Post you codes that you have been thinking where the problem was.
Post you codes that you have been thinking where the problem was.
This is the link to the sub-menu
You'll be able to view source code there
Thanks
Try adding a float: left to the div that wraps those elements.
Excellent that did the trick. Thank you.
A little odd how it worked fine in IE9 and Chrome, but not FF4.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.