what is Pseudo-Classes & Elements ?
Pseudo-classes allow you to apply styles to an element based on its state, its interaction with the user, or its position in the document. Single colon is the syntax for pseudo classes.
CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected elements].
4 link related pseudo class selectors
-link
-visited
-hover
-active
:link
Adds style to an unvisited hyperlinks.
a:link {
color: #FF0066;
}
:visited
Styles for links that have already been visited.
a:visited {
color: #FF0066;
}
:active
Adds style to an activated link.
a:active {
color: #FF0066;
}
:hover
Adds style to an element when you mouse over it.
a:hover {
color: #FF0066;
}
In general terms, a pseudo-class is sort of a phantom state or a specific characteristic of an element that we can target with CSS. Pseudo-classes allow you to apply styles to an element based on its state, its interaction with the user, or its position in the document. Single colon is the syntax for pseudo classes.
Top comments (2)
Hello ! Don't hesitate to put colors on your
codeblock
like this example for have to have a better understanding of your code 😎Thank you. I didnt know about that