本文介绍了after和:: after之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 它说的区别是:after是CSS2,while :: after是CSS3。有没有更重要的区别?It says the difference is that :after is CSS2, while ::after is CSS3. Are there any more important differences?(我试过Googling,但冒号似乎抛弃了搜索)(I've tried Googling, but the colons seem to throw off the search)推荐答案伪元素在CSS2中用单个冒号表示,但在CSS3中被改变以建立伪类和伪元素之间的区别。出于兼容性考虑,CSS 1和CSS2中定义的伪元素仍允许使用单个冒号。Pseudo-elements were denoted with a single colon in CSS2, but have been changed in CSS3 "in order to establish a discrimination between pseudo-classes and pseudo-elements". For compatibility reasons a single colon is still allowed for the pseudo-elements defined in CSS 1 and CSS2. CSS3CSS3伪元素由两个冒号c $ c> :: ),后跟伪元素的名称。A pseudo-element is made of two colons (::) followed by the name of the pseudo-element.这个 :: 符号是由当前文档引入的,以便建立伪类和伪 - 元素。 为了与现有样式表兼容,用户代理还必须接受CSS级别1和2中引入的伪元素的前一个冒号符号(即:first-line,:first-letter,:before和:after )。此兼容性不允许用于本规范中引入的新伪元素。This :: notation is introduced by the current document in order to establish a discrimination between pseudo-classes and pseudo-elements. For compatibility with existing style sheets, user agents must also accept the previous one-colon notation for pseudo-elements introduced in CSS levels 1 and 2 (namely, :first-line, :first-letter, :before and :after). This compatibility is not allowed for the new pseudo-elements introduced in this specification. 这篇关于after和:: after之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 07-31 06:26