html - Ul LI 菜单在 IE 中不显示为 block

标签 html css internet-explorer html-lists

我有一个菜单可以在 Firefox 和 Chrome 中正确显示,在 IE8 中它显示为垂直列表而不是水平菜单。

我不确定为什么这不起作用。 我有一个文档类型,我正在通过谷歌链接到 html5 js。

如有任何建议,我们将不胜感激。 提前感谢您的宝贵时间。

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:

注意:不知道为什么,但我很难显示从这里开始的 div。所以在 ul 之前是一个 div id "tools"

< 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: left:

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

关于html - Ul LI 菜单在 IE 中不显示为 block ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19499611/

相关文章:

html - li 内的可点击图标和文本

html - 链接在表中不起作用

html - 强制水平列表 100% 宽度

Html css 图片问题 windows IE FF GChrome

internet-explorer - CSS3 关键帧动画在 Firefox 和 IE 中不起作用

android - 如何创建在手机上响起电话号码的链接?

javascript - 根据变量响应隐藏 div

javascript - 如何将 prop 的属性映射到 Vue 的属性中

css - 如何在 CSS 中的省略号文本溢出旁边(右侧)添加文本?

仅限 jQuery:IE,即使选择了项目,input:checked也会返回 0