Pseudo-classes and pseudo-elements

Pseudo-classes and pseudo-elements appeared in css2, and they were all represented by :. Later, css3 added pseudo-classes and pseudo-elements, and changed the pseudo-elements to be represented by :: to show the difference from pseudo-classes.

The so-called pseudo-class:

1. The effect can be achieved by adding the actual class

2. Can use more than one at the same time

3 Stateful pseudo-classes, structural pseudo-classes, and form-related pseudo-classes

pseudo-element

1. The effect can be achieved by adding actual elements

2. Only one can be used at the same time, and it can only appear at the end of the declaration

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325297051&siteId=291194637