pseudo-class is a selector which specifies a specific state of the selected element. For example
:hover enables the developer to target the state when an element is being hovered.
In this article, we will cover some helpful
:hover is probably the most used
pseudo-class in CSS. It selects the state of the element when the user hovers over it using a pointing device, like a mouse.
If you are looking to create the hover effect in the demo, you might like this article
:focus is used to select the state of an element when the user selects it. To use this
pseudo-class, you need a selectable component, like a button or an input, or manually convert it to a tab-able element using tabindex.
:checked targets radio and checkbox inputs when they are checked or toggled.
:disabled are employed to select the state of an input element when it is enabled and disabled.
:invalid target input elements whose input text are valid and invalid.
pseudo-class matches the root element of a tree representing the document. In HTML,
:root represents the
<html> element and is identical to the selector
html, except that its specificity is higher. It is frequently used to add CSS variables.
How to implement the Dark Mode is given in this article
:nth-child() targets a component if it is the first, last and the nth child of a parent element.
:nth-child can be used as
:first-child by using
:nth-of-type respectively selects the first, last and nth occurrence of a given element in the HTML body.
:nth-of-type can be used as
:first-of-type by using
Want to work together? Contact me on Upwork
Connect to me on: