The difference between a colon and two colons in CSS

Source: Internet
Author: User
A single colon (:) used for CSS3 pseudo-classes, double colons (::) for CSS3 pseudo-elements.
A pseudo-element consists of a double colon and a pseudo-element name. Double colons are introduced in the CSS3 specification to differentiate between pseudo-classes and pseudo-elements.
But pseudo-class compatible with existing styles, the browser needs to support the old pseudo-class, such as: First-line,: First-letter,: Before, after and so on.
For pseudo-elements that existed before CSS2, such as: Before, single colon, and double colon: the Before function is the same.
Reminder, if your site only need to be compatible with WebKit, Firefox, Opera and other browsers, it is recommended to use a double colon for the pseudo-element notation
If you have to be compatible with IE, it is safer to use CSS2 's single colon notation.

The difference between a colon and two colons in CSS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.