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; }