CSS defines the correct order of four states of a hyperlink l-v-h-a

Source: Internet
Author: User

CSS defines hyperlinks in a sequential order. Otherwise, there may be bugs in some browsers where a style does not work. The desired effect is not displayed correctly.

The order in which CSS properties are arranged: L-v-h-a.

L-v-h-a is a shorthand for link, visited, hover, and active.

Each of them represents

A:link Default style for hyperlinks
A:visited visited (already seen) Link styles
A:hover link style with mouse hover state
A:active when the left mouse button is pressed, is activated (is the mouse down that moment) link style.

The normal order is as follows:

Copy Code code as follows:
A:link{color: #333; text-decoration:none;}
a:visited {color: #333; text-decoration:none;}
a:hover {color: #FF6600; text-decoration:underline;}
a:active {text-decoration:none; color: #FF6600; text-decoration:none;}


This is how we write our daily work.

Copy Code code as follows:
A {color: #252525; text-decoration:none;}
a:visited {text-decoration:none;}
a:hover {color: #ba2636; text-decoration:underline;}
a:active {color: #ba2636;}


Now everyone is looking at is not simple, clear.

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.