This is a re-ask of my previous question , with more information based on further experiments and research.
Here is a model that works in IE, Safari and Chrome, and fails in Firefox 22.
I have a drop-down navigation of the following properties:
The problem: display:table-cell removes the sub-menu's awareness of the top-level LI's width, in Firefox only. It works in every single other browser I have tried it in (except IE7, where it breaks in a way that is acceptable).
Removing display:table-cell fixes the issue, but brings back an earlier issue where the sub-menus appear at different heights when their parents are different heights.
I am looking for either:
Help and suggestions greatly appreciated.
HTML
<div id="topnavblock">
<ul id="topnav">
<li><a href="#">Here is a top-level menu item</a>
<ul>
<ul class="navwrap3">
<li class="navwrap1">
<ul class="navwrap2">
<li><a href="#">Menu item 1</a></li>
<ul>
<li><a href="#">Sub-menu 2</a></li>
<li><a href="#">Sub-menu 2</a>
<ul>
<li>Third level nested menu</li>
</ul>
</li>
<li><a href="#">Sub-menu 2</a></li>
</ul>
</li>
<li><a href="#">Sub-menu 3</a></li>
</ul><!--end navwrap2-->
</li> <!--end navwrap1-->
</ul><!--end navwrap3-->
</ul>
</li>
<li><a href="#">Here is a top-level menu item</a></li>
</ul>
</div>
CSS
#topnavblock {
width:100%;
position:relative;
display:table;
}
#topnav {
display:table-row;
}
#topnav > li {
max-width:100px;
display:table-cell;
vertical-align: middle;
border-right: 1px solid yellow;
}
ul#topnav li .navwrap1 {
background: yellow;
width: 210px;
position: relative;
}
ul#topnav li .navwrap2 {
background:grey;
}
ul#topnav > li > ul {
border-right: 3px solid red;
}
ul#topnav ul .navwrap3 {
border-left:3px solid green;
padding-top:60px;
}
ul#topnav .navwrap2 li {
float: none;
background:lightgreen;
width:100%;
}
ul#topnav li:hover ul {
visibility: visible;
}
<li><a href="#">Menu item 1</a></li>
行不应以</li>
标记结尾。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.