Pseudo Elements
- Pseudo-elements are parts of the page that can be targetted with CSS but that do NOT have an HTML tag around the content.
- Pseudo-elements have two colons in front of the selector name. Eg:
::after
::before
- With
::after
and::before
we can actually add new content through the CSS, using thecontent
property. - That content can be styled with any properties we want.
- Other examples are
::first-letter
::first-line
and more. - pseudo-elements vs pseudo-classes video
- pseudo-elements after and before video
div::after {
content: "new content";
color: red;
display: block;
}