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

What is the function and writing order of the a tag pseudo class
The role of the a tag pseudo-class:

":link": the state of a tag that has not been visited;

":visited": the state that a tag has been visited;

":hover": the state when the mouse is hovering over the a tag;

":active": the state of a tag when it is pressed by the mouse;

When writing styles, why do you write them in this order:

In fact, the essence is still "styles with equal priority, the ones written later will cover the ones in front". The pseudo-class of the a tag is just a combination of different action sequences. The triggering order of the actions determines that the order of the pseudo-classes must be written according to lvha.

Let's briefly talk about these four pseudo-classes:

Because the first two states are normal, and the last two are immediate. When the immediate state is triggered, it will override the normal state, so the two immediate states should be placed at the end.

Because under normal circumstances: if the a tag has been visited, it should be displayed as visited, so visited should be placed after link;

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

Sequential memory techniques:

LV package

<<:  Implementing a table scrolling carousel effect through CSS animation

>>:  JavaScript Document Object Model DOM

Recommend

JavaScript function detailed introduction

Any number of statements can be encapsulated thro...

How to query the minimum available id value in the Mysql table

Today, when I was looking at the laboratory proje...

Solve the problem of Navicat for Mysql connection error 1251 (connection failed)

Because what I wrote before was not detailed enou...

An example of the difference between the id and name attributes in input

I have been making websites for a long time, but I...

Linux operation and maintenance basic swap partition and lvm management tutorial

Table of contents 1. Swap partition SWAP 1.1 Crea...

Detailed explanation of several storage methods of docker containers

Table of contents Written in front Several storag...

Self-study of MySql built-in functions knowledge points summary

String functions Check the ascii code value of th...

sql script function to write postgresql database to implement parsing

This article mainly introduces the sql script fun...

How to build Apr module for tomcat performance optimization

Preface Tomcat is a widely used Java web containe...

Vue monitoring properties and calculated properties

Table of contents 1. watch monitoring properties ...

How to implement Hover drop-down menu with CSS

As usual, today I will talk about a very practica...

How to implement batch deletion of large amounts of data in MySQL large tables

The question is referenced from: https://www.zhih...