我的网站在所有主流浏览器上运行良好,直到更新到Safari 5.1.现在,主导航被破坏了.我在list元素中的anchor元素上使用display:table-cell,并且还使用了font-size:0 hack来删除菜单元素之间的间距.有没有其他人遇到过这个问题,并有一个他们可以提供的解决方案?
CSS:
#navigation {
padding-top: 7px;
}
#navigation ul.links,/* Main menu and secondary menu links */
#navigation .content ul /* Menu block links */ {
margin: 0;
padding: 0;
display: block;
font-size: 0; /* this is a hack so that the spacing between the menu buttons disappear
since they are inline-block elements,this should be unneccessary when
CSS3 is approved */
}
#navigation ul.links li,/* A simple method to get navigation links to appear in one line. */
#navigation .content li {
display: inline-block;
padding-right: 0;
padding-left: 0;
margin: 0;
/* below is a fix for IE7 to get the main navigation items lined up correctly
* in one row
*/
zoom: 1;
*display: inline;
}
#main-menu ul {
width: 100%;
}
#main-menu li {
width: 108px;
text-align: center;
padding-bottom: 7px;
font-size: 11pt;
}
#main-menu a {
display: table-cell;
width: inherit;
text-decoration: none;
font-size: 0.9em;
color: #035B9A;
background-color: white;
height: 30px;
vertical-align: middle;
}
HTML:
最佳答案