简体   繁体   English

Ul LI菜单在IE中未显示为“阻止”

[英]Ul LI Menu not displaying as Block in IE

I have a menu that displays properly in Firefox and Chrome, in IE8 it displays as a vertical list rather than a horizontal menu. 我有一个可以在Firefox和Chrome中正常显示的菜单,在IE8中,它显示为垂直列表而不是水平菜单。

I am not sure why this is not working. 我不确定为什么这不起作用。 I have a doctype, and I am linking to the html5 js via google. 我有一个doctype,我通过Google链接到html5 js。

Any suggestions would be appreciated. 任何建议,将不胜感激。 Thank you in advance for your time. 预先感谢您的宝贵时间。

CSS: CSS:

#tools {position: absolute; top: -23px; right: 7px; font-size: 0.75em;} 
#tools li {list-style:none; display: inline-block; padding: 0px 10px; border-left: 1px solid #e8e4d8; line-height: 1; margin: 0;}
#tools li:first-child {padding-left: 0; border-left: 0;}
#tools a {color: #e8e4d8; line-height: 1; margin: 0; padding: 0 0 1px 0; display: block; text-decoration: none;}
#tools a:hover {text-decoration: underline;}

HTML: HTML:

Note: not sure why but I am having a hard time displaying the div that starts here. 注意:不知道为什么,但是我很难显示从这里开始的div so before the ul is a div id "tools" 因此,在ul前是div id“工具”

< div id="tools" >         
<ul>
    <li><a href="">link</a></li>
    <li><a href="">link</a></li>
    <li><a href="">link</a></li>
    <li><a href="">link</a></li>
    <li id="last_tool"><a href="">link</a></li>
</ul>
</div>

您需要将float:设置在列表项上:

#tools li {list-style:none; display: inline-block; padding: 0px 10px; border-left: 1px solid #e8e4d8; line-height: 1; margin: 0; float: left;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM