Four states in the CSS style of a tag

Source: Internet
Author: User
This article mainly introduces the CSS style of a tag in the four states, has a certain reference value, now share to everyone, the need for friends can refer to

A label has four "state" the process is: A:link->a:hover->a:active->a:visited. In addition, a:active can not be set with or without underscores (always there), there is an example below you can see

Represents a connection in all States, such as a{color:red}
①a:link: Link not visited, such as a:link {Color:blue}
②a:visited: visited links, such as A:visited{color:blue}
③a:active: The color of the link when it is activated (when the link gets focus), such as A:active{color:blue}
④a:hover: When you move the mouse over a link, such as a:hover {Color:blue}
The status of the general A:hover and a:visited links (colors, underscores, etc.) should be the same.
The first three correspond to the three attributes of the BODY element link, Vlink, and ALink respectively.
The four "states" of the sequence of the process is: A:link->a:hover->a:active->a:visited. In addition, a:active cannot be set with or without underscores (always there).
Example: Common state values for pseudo-classes

<style type = "Text/css" > a {font-size:16px} a:link {color:blue; text-decoration:none;}//Not visited: Blue, no underline a:active:{co lor:red; }//Activation: Red a:visited {color:purple;text-decoration:none;}//Visited: purple, no underscore a:hover {color:red; Text-decoration: underline;} Mouse Move Up: red, underline </style>

above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.