In the Paint Store project of the Web Dev foundations course, The following CSS is found:
footer:before { /* Overlay */
position: absolute;
content: "";
top: 0;
left: 0;
width: 100%;
height: 100%;
rgba(255, 128, 0, 0.75)
}
I couldn’t remember from the previous materials what a colon means in CSS selectors, so I looked it up on MDN and came to the CSS pseudo-classes section. However, there’s no :before
pseudo-class on this page.
Using a web search engine, I came across the list of pseudo-elements - which does feature ::before
, but on order to be a pseudo-element, it would need a double colon ::
So the :before
is not a pseudo-class (doesn’t exist) and not a pseudo-element (missing a colon); then what is it?