Are CSS3 ::before and ::after pseudo elements supported by IE9 or not?(IE9 是否支持 CSS3 ::before 和 ::after 伪元素?)
问题描述
关于这个 MS 兼容性表 它说,IE9 不支持伪元素 ::before 和 ::after,但是当我尝试它时,它似乎确实...见 JSBin
On this MS compatibility table it says, IE9 does not support pseudo-elements ::before and ::after, but when I try it seems it does... see JSBin
我做错了吗?我认为 ::before 和 ::after 会是很好的工具来隐藏 IE9 中的内容,而事实上它们并没有.
Am I doing something wrong? I thought ::before and ::after would be nice tools to hide stuff from IE9, when in fact, they don't.
推荐答案
CSS2伪元素:before和:after,采用传统的单冒号,受 IE8 及更高版本支持.它们对 CSS3 并不陌生.
The CSS2 pseudo-elements :before and :after, with the traditional single-colon notation, are supported by IE8 and later. They are not new to CSS3.
另一方面,双冒号表示法是 CSS3 的新内容.IE9 确实支持 ::before 和 ::after,对于 CSS1 伪元素 ::first-line 和 ::first-letter.然而,今后不会有新的伪元素使用单冒号语法,并且浏览器(包括 IE)应该支持所有伪元素的双冒号语法.
The double-colon notation, on the other hand, is new to CSS3. IE9 does support this new notation for ::before and ::after, and likewise for the CSS1 pseudo-elements ::first-line and ::first-letter. Going forward, however, no new pseudo-element may use the single colon syntax, and browsers (including IE) are expected to support the double colon syntax for all pseudo-elements.
我不知道为什么该表说 IE9 不支持新的伪元素语法,因为根据上面链接的各个选择器的文档和您的测试用例,它确实支持.当然,还有这个答案.
I have no clue why that table says IE9 doesn't support the new pseudo-element syntax, because it certainly does according to the docs for the individual selectors linked above, and your test case. As well as, of course, this answer.
这篇关于IE9 是否支持 CSS3 ::before 和 ::after 伪元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IE9 是否支持 CSS3 ::before 和 ::after 伪元素?
基础教程推荐
- Javascript 在多个元素上单击事件侦听器并获取目标 2022-01-01
- 为什么我在 Vue.js 中得到 ERR_CONNECTION_TIMED_OUT? 2022-01-01
- 每次设置弹出窗口的焦点 2022-01-01
- 什么是不使用 jQuery 的经验技术原因? 2022-01-01
- jQuery File Upload - 如何识别所有文件何时上传 2022-01-01
- WatchKit 支持 html 吗?有没有像 UIWebview 这样的控制器? 2022-01-01
- 如何使用sencha Touch2在单页中显示列表和其他标签 2022-01-01
- 如何在特定日期之前获取消息? 2022-01-01
- Node.js 有没有好的索引/搜索引擎? 2022-01-01
- 如何使用 CSS 显示和隐藏 div? 2022-01-01
