CSS Mastery applies styles to links

Source: Internet
Author: User

CSS link pseudo-class selector:

  : Link---Used to select links that have not been visited

: Visited---Used to select links that have been visited

: hover---The element used to select the mouse hover

: Active---is used to select the element being activated, and for a link, activation occurs when the link is clicked

One of the reasons most people initially use these selectors is to remove the underline below the link, and then open the underline when the mouse hovers over the link or when clicked. The way to do this is to set the Text-decoration property of the unreachable and visited links to none, and set the text-decoration for the mouse-over and the active link to underline:

{text-decoration: none;}  {text-decoration: underline;}

In the previous instance, the order of the selectors is important, and if the order is reversed, the mouse pauses and the active style does not work:

{text-decoration: underline;}  {text-decoration: none;}

This is caused by cascading: When two rules have the same specificity, the rules that are defined later take precedence. So the correct liking should be: a:link,a:visited,a:hover,a:active.

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.