Home  >  Article  >  Web Front-end  >  Introduction to css pseudo-class selector

Introduction to css pseudo-class selector

王林
王林forward
2020-07-01 17:01:163311browse

Introduction to css pseudo-class selector

Pseudo class selector:

(Recommended learning: css quick start)

1, link, hover, active, visited

a:link (unvisited link state), used to define the regular link state.

a:hover (the state when the mouse is placed on the link), used to produce visual effects.

a:active (the state when the mouse is pressed on the link).

a:visited (visited link status), you can see the links that have been visited.

a:link{color: black}
a:hover{color: yellow}
a:active{color: blue}
a:visited{color: red}
 
<a href="#">Nick</a>

2, before, after

P:before Insert content before the content of each e388a4556c0f65e1904146cc1a846bee element.

P:after inserts content after the content of each e388a4556c0f65e1904146cc1a846bee element.

p {
    color: yellow;
}
p:before{
    content: "before...";
}
p:after{
    content: "after...";
}

<p> Nick </p>

The above is the detailed content of Introduction to css pseudo-class selector. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete