用CSS制作立体导航栏的办法-
CSS制作立体导航
结果图:
1
简略来说单冒号(:)用于CSS3伪类,双冒号(::)用于CSS3伪元素。
w3c对于css选中器的标准:
A pseudo-element is made of two colons (::
) followed by the name of the pseudo-element.
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.
简略翻译:伪元素由双冒号和伪元素名称组成。双冒号是在目前标准中引入的,用于区分伪类和伪元素。不外阅读器需要同时支撑旧的已经存 在的伪元素写法,比方:first-line、:first-letter、:before、:after等,而新的在CSS3中引入的伪元素则不允许再支撑旧的单冒号的写法。
那么此刻就可以完备的答复标题中的题目了,关于CSS2以前已有的伪元素,比方:before,单冒号和双冒号的写法::before作用是同样的。
所以,要是你的网站只需要兼容webkit、firefox、opera等阅读器,倡议关于伪元素采纳双冒号的写法,要是不得不兼容IE阅读器,还是用CSS2的单冒号写法比拼平安。
以上就是用CSS制作立体导航栏的办法的细致内容,更多请关注 百分百源码网 其它相干文章!