Course Content
CSS Fundamentals
CSS Fundamentals
Decorative Pseudo-Elements
Pseudo-elements ::before
and ::after
are special selectors that allow us to insert content before or after an element's content. We use them to add decorative elements, such as icons or borders, to an element's content without modifying the actual HTML content.
::before
add the content before the element content;::after
adds the content after the element content.
Let's consider the following example, where our task is to add some decoration for the hover effect on the links:
index
index
index
Everything was clear?