Home  >  Article  >  Web Front-end  >  Four states in the css style of the a tag

Four states in the css style of the a tag

不言
不言Original
2018-06-12 11:17:204204browse

This article mainly introduces the four states in the css style of the a tag. It has certain reference value. Now I share it with you. Friends in need can refer to it.

There are four states in the a tag The sequence of "status" is: a:link ->a:hover ->a:active ->a:visited. In addition, a:active cannot be set with or without an underscore (it is always present). There is an example below that you can look at.

represents connections in all states, such as a{color:red}
① a: link: Unvisited link, such as a:link {color:blue}
② a:visited: Visited link, such as a:visited{color:blue}
③ a:active: When activated (the link gets focus when) the color of the link, such as a:active{color:blue}
④ a:hover: when the mouse moves over the link, such as a:hover {color:blue}
Generally a:hover and a:visited The status of the link (color, underline, etc.) should be the same.
The first three correspond to the link, vlink, and alink attributes of the body element respectively.
The sequence of the four "states" is: a:link ->a:hover ->a:active ->a:visited. In addition, a:active cannot be set with or without underline (it is always present).
Example: Common status values ​​of pseudo-classes

The above is the entire content of this article. I hope it will be helpful to everyone's learning. For more related content, please pay attention to the PHP Chinese website!

Related recommendations:

CSS Introduction to the use of Border attribute solid

Explanation of css mouse style cursor

The above is the detailed content of Four states in the css style of the a tag. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn