CSS3 learning-use CSS to create a three-dimensional navigation bar and css3css navigation bar
<! Doctype html>
:
1
2
Summary:
1. unordered list is used for the body part.
2. (1) hover
The effect of moving the mouse over.
(2) Questions: Before AND: before
In short, a single colon (:) is used for the CSS3 pseudo class, and a double colon (: :) is used for the CSS3 pseudo element.
W3c standards for css selectors:
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.
Pseudo elements consist of double colons and pseudo element names. Double colons are introduced in the current specification to distinguish between pseudo classes and pseudo elements. However, the browser also needs to support the old pseudo-element writing method, such as first-line, first-letter, before, and after, the new pseudo elements introduced in CSS3Not AllowedThe old single colon statement is supported.
Now we can answer all the questions in the title. For the existing pseudo elements in CSS2, such as before, single colon and double colon, the statement is: before.The role is the same.
So, if your websiteOnlyCompatible with browsers such as webkit, firefox, and opera. We recommend that you use double colons for pseudo elements. If you have to be compatible with IE browsers, it is safer to use a single colon in CSS2.