What is the function and writing order of a tag pseudo class


The functions of a tag pseudo class are as follows

“: link”: the state in which a tag has not been accessed;

“: visited”: the state in which a tag has been accessed;

“: hover over the mouse”: hover over the label;

“: active”: the state of a tag when pressed by the mouse;

When writing a style, you should write it in this order:

In fact, the essence is “the style with the same priority. Those written in the back will cover the front”. The pseudo class of a tag only combines different action sequences. The triggering order of actions determines the order of pseudo classes, which must be written according to lvha.

The following is a brief introduction to the four pseudo classes:

Because the first two states are normal, and the latter two are real-time states. When the real-time state is triggered, the normal state should be covered, so the two real-time states should be placed behind;

Because under normal conditions: if the a tag is accessed, it will present the visited state, so visible should be placed after the link;

Because when the mouse is pressed, it is accompanied by the hovering a tag, so if you want to cover hover with active, you must put active at the back;

Sequential memory skills:

LV package for Hao