Use of pseudo elements in CSS

author details
AdiPie
23rd Dec 2020
1 min read
Image
Use of pseudo elements in CSS

CSS Pseudo-elements is a selector that designs a specific part of a selected element instead of the whole thing. Let's have an example, you can provide the style in the last line of the div or first letter of the ul list or table or in any HTML tag/element.

The Pseudo-elements always initiate with a double colon(::), although a single colon is always a consideration in reverse similarity. So, let see some of the samples of Pseudo-elements given below: 

 

div::first-line { ... }

a::first-letter { ... }

::selection { ... }

.navbar::after { ... }

.header::before { ... }