pseudo class css
.element:nth-child(1)
.element:hover
.element:visited
pseudo class css
.element:nth-child(1)
.element:hover
.element:visited
the syntax of pseudo-class in css
The syntax of pseudo-classes:
selector:pseudo-class {
property:value;
}
css pseudo classes
a:link{
color: blue;
}
a:visited{
color: purple;
}
a:hover{
color: red;
}
a:active{
color: green;
}
p:first-child{
background: #05ffb0;
border: 1px solid;
padding: 5px;
}
p:last-child{
background: #05ffb0;
border: 1px solid;
padding: 5px;
}
p:nth-child(3){
background: #05ffb0;
border: 1px solid;
padding: 5px;
}
p:nth-child(2n+1){
background: #05ffb0;
border: 1px solid;
padding: 5px;
}
css psedo class
button:hover {
color: blue;
}
A pseudo-class is a word such as :hover that makes its changes
to the selected element by adding it along side the selector
before the curly braces in CSS instead of inside the curly
braces.
You can search for a list of pseudo-class online.
css pseudo classes
/* unvisited link */
a:link {
color: #FF0000;
}
/* visited
link */
a:visited {
color: #00FF00;
}
/* mouse over link */
a:hover {
color: #FF00FF;
}
/* selected link */
a:active {
color: #0000FF;
}
css pseudo classes
button/anchor:hover / :active / :checked
:nth-of-type(3) // select the third element
:nth-of-type(3n) // select an element every three
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us