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

Summary of 10 must-see JavaScript interview questions (recommended)

1.This points to 1. Who calls whom? example: func...

Solve the problem of case sensitivity of Linux+Apache server URL

I encountered a problem today. When entering the ...

Realize super cool water light effect based on canvas

This article example shares with you the specific...

How to use nginx to build a static resource server

Taking Windows as an example, Linux is actually t...

Detailed explanation of the processing of the three Docker Nginx Logs

Because colleagues in the company need Nginx log ...

MYSQL unlock and lock table introduction

MySQL Lock Overview Compared with other databases...

MySQL learning notes: data engine

View the engines supported by the current databas...

Let's talk about my understanding and application of React Context

Table of contents Preface First look at React Con...

Detailed Example of MySQL curdate() Function

MySQL CURDATE Function Introduction If used in a ...

How to use bind to set up DNS server

DNS (Domain Name Server) is a server that convert...

Implementation steps of Mysql merge results and horizontal splicing fields

Preface Recently, I was working on a report funct...

Two methods of implementing automatic paging in Vue page printing

This article example shares the specific code of ...