Getting Started with CSS (5)--css hyperlink A

Source: Internet
Author: User

1 a: Link{

2 color:red;

3}

4 a: visited{

5 Color:orange;

6}

7 a: hover{

8 Color:green;

9}

Ten a: active{

One color:black;

}

: Link says the user has not clicked on the link's style. It means "link" in English.

: Visited says that the user has accessed the style of this link. It means "visited" in English.

: hover indicates the style of the link when the user hovers over the mouse. It means "hover" in English.

: Active means that the user clicks on the link with the mouse, but does not let go, the style of the moment. It means "active" in English.


Remember, these four states, in CSS, must be written in a fixed order:

A:lInk, A:visited, a:hover, a:active

If you do not follow the order, it will fail. "Code of Love and Hate"love hate. Must first love, after hate.

1. Nav ul Li a{

2 Display:block;

3 width:120px;

4 height:40px;

5}

6. Nav ul Li a:link,. Nav ul Li a: visited{

7 Text-decoration:none;

8 Background-color:yellowgreen;

9 Color:white;

10}

Nav ul Li a:hover{

Background-color:purple;

Font-weight:bold;

Color:yellow; }

The most standard is to write link, visited, hover. But the front-end development engineers in a lot of practice, found not to write link, visited browser is also quite compatible. So these "old fried dough sticks", they have simplified a label:

A:link, a:visited can be omitted, abbreviated in a tag. In other words, a tag covers the status of link and visited.

1. Nav ul Li a{

2 Display:block;

3 width:120px;

4 height:50px;

5 Text-decoration:none;

6 background-color:purple;

7 Color:white;

8}

9. Nav ul Li a:hover{

Ten Background-color:orange; }

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.