gpt4 book ai didi

伪类之前的css3

转载 作者:行者123 更新时间:2023-11-28 11:15:05 25 4
gpt4 key购买 nike

我试图找出使用一个冒号“:”和两个“::”之间的区别,我看到它们都在使用伪类。例如,我在伪类之前尝试过这个,当我用这两种方法时它工作正常。

两者有什么区别吗?

最佳答案

最初没有区别!但是CSS3中引入了这个符号来区分伪元素和伪类:

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 CSS level 3.

the according section in the spec

关于伪类之前的css3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9230777/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com