html - HTML 页面中的连字符列表在 IE 8 中不起作用

标签 html css internet-explorer

下面的代码在 IE 8 中不工作,除了这个浏览器它在所有浏览器中工作。谁能帮我解决这个问题?

CSS

ul.hyphen-list {
    list-style-type: none;
    margin-left: 1.5em;
    padding-left: 1em;
    text-indent: -0.85em;
}

ul.hyphen-list li:before {
    content: "- ";
}

HTML

<ul class="hyphen-list">
    <li>This is line 1<br/>part 2</li>
    <li>This is line 2</li>
</ul>

最佳答案

ul.hyphen-list {
  list-style: none;
}

在 IE8 的浏览器堆栈上测试;工作正常 - http://jsfiddle.net/9RGeB/7/

http://jsfiddle.net/9RGeB/7/show/

记住:IE 7 不支持 :before

http://css-tricks.com/browser-support-pseudo-elements/

关于html - HTML 页面中的连字符列表在 IE 8 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22095750/

相关文章:

javascript - jQuery ID 选择器仅适用于第一个元素

javascript - Html 十六进制函数参数意外地被转换为十进制。

css - 单击边框淡入淡出/缩放?

javascript - 为不同的浏览器包含不同的类

html - 在一行中混合 CSS 格式

html - IE6真的不允许我从左/右/上/下设置宽度/高度吗?

php - 如何在 Codeigniter 中检查 session 是否已设置?

html - 如何在 html 中留下 50dp 的空白区域?

javascript - 如何提高我网站的 IE6/7 JS 性能?

css - IE 的 div 高度/宽度与 Firefox 不同