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

Introduction to css pseudo-class selector

王林
Release: 2020-07-01 17:01:16
forward
3338 people have browsed it

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>
Copy after login

2, before, after

P:before Insert content before the content of each

element.

P:after inserts content after the content of each

element.

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

<p> Nick </p>
Copy after login

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template