CSS 内容计数器破坏 IE 中的 CSS
我确实希望该网站需要进行一些调整才能在 IE 中运行,尽管这次看起来有些东西完全破坏了 IE8 兼容模式下的 CSS。
为了从顶部的徽标位置开始,我添加了一个红色背景来检查其位置,尽管您可以在 Firefox 中看到它,但它甚至没有显示。为什么这没有被正确读取?
编辑:
我已将其范围缩小到导致 IE 崩溃的确切代码:
.content ol li:before {
content: counters(item, ".") ": ";
counter-increment: item
}
怎么可能我能解决这个问题吗?无需手动添加数字。我希望编号列表的工作方式如下:1.1.2 等
I do expect the site to require a few tweaks to work in IE although this time it appears like something is completely breaking the CSS in IE8 compatibility mode.
To start at the top with the logo position, I have added a red background to check its location and this is not even displayed, although you can see this in firefox. How come this is not being read correctly?
EDIT:
I have narrowed this down to the exact code which causes IE to break:
.content ol li:before {
content: counters(item, ".") ": ";
counter-increment: item
}
How could I get around this? Without manually adding the numbers. I wanted the numbered list to work like: 1.1.2 etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我自己解决了这个问题,为了避免 IE7 解析器错误,将:更改
为
“注意项目和逗号之间的空格”。您还可以将 item 括在括号中,它似乎适用于所有主要浏览器,尽管它看起来有点不标准。
Having worked through this issue myself, to avoid the IE7 parser error, change:
to
Note the whitespace between item and the comma. You can also wrap item in parentheses and it seems to work with all major browsers, though it seems a bit nonstandard.
透明 PNG 图像在 IE 中不起作用。
这是一个很好的解释和解决方案:http://24ways.org/2007/supersleight-transparent-png-in-ie6
Transparent PNG images don't work in IE.
Here's a nice explanation and solution: http://24ways.org/2007/supersleight-transparent-png-in-ie6
IE<8 不支持生成的内容(请参阅何时可以使用...)。简短的搜索没有返回任何明显的替代方案(垫片等)。您能否接受 IE6/7 不会看到您的计数器,或者使用 Chrome 内嵌框架 ?
Generated content isn't supported in IE<8 (see When can I use...). A brief search didn't return any obvious alternative (a shim etc). Can you just accept that IE6/7 won't see your counters, or perhaps use Chrome Frame?