Pseudo Selectors in CSS

ยท

1 min read

Table of contents

No heading

No headings in the article.

Pseudo Selectors in CSS ,they often serve quite specific purposes.they act as if you had added a whole new HTML element into the markup, rather than applying a class to existing elements. Pseudo-elements start with a double colon :: .

Screenshot from 2022-08-15 09-49-24.png

Some early pseudo-elements used the single colon syntax, so you may sometimes see this in code or examples. Modern browsers support the early pseudo-elements with single- or double-colon syntax for backwards compatibility

In this a article We are going to discuss about ::before and ::after which are used along with the content property to insert content into your document using CSS.

::before

We use ::before to inject an element before our selected content.

image.png

image.png

image.png

::after

We use ::after to inject an element before our selected content.

image.png

image.png

image.png

ย