简体   繁体   English

IE7中的水平li显示为垂直

[英]Horizontal li in IE7 shows as vertical

I have tried a number of tweaks and fixes from SO along with some other posts found on the net but I still can not get this list to show horizontal in IE7. 我已经尝试了SO的一些调整和修复,以及在网上找到的其他一些帖子,但是我仍然无法获得此列表以在IE7中显示水平。

I have checked the html and css with the validator and it is valid, no errors. 我已经用验证器检查了html和css,它是有效的,没有错误。

I have stripped out virtually everything not related to the ul/li here http://dogmatic69.com/tmp/test.html 我已经在这里http://dogmatic69.com/tmp/test.html上剥离了与ul / li不相关的几乎所有内容

Any help greatly appreciated, thanks. 任何帮助,不胜感激,谢谢。

Unless you need to explicitly float the list items, don't. 除非您需要显式浮动列表项,否则不需要。 Use display: inline; 使用display: inline;

IE 6 & 7 dont like display:inline-block; IE 6和7不喜欢display:inline-block; for some reason. 由于某些原因。

Try using the code below. 尝试使用下面的代码。 Please note it will probably break it in modern browsers so make use you put it in your IE 6/7 only CSS files. 请注意,它可能会在现代浏览器中破坏它,因此请充分利用它,将其放在仅IE 6/7的CSS文件中。

<!--[if IE 7]>
    <style> li { display: inline-block; display:block; } </style>
<![endif]-->

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

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