Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "pseudo" mean in CSS? [duplicate]

When I read about CSS and HTML I cross the word pseudo-elements.

I haven't found a good short explanation for what pseudo means. Could someone please explain this to me?

like image 706
OuuGiii Avatar asked Dec 02 '22 13:12

OuuGiii


1 Answers

psuedo-elements allow you to style specific parts of an element. Some examples of pseudo-elements are:

  • ::after
  • ::before

These specific ones allow you to add style to just after, or just before an element.

for example:

.test {
    background-color: gray;
}

.test::after {
    content: ' some more text';
    color: red
}
<div class='test'>
    testing...
</div>

Here, we style the .test element normally

BUT, then we add a bit more after it using the pseudo-element selector ::after to let us add more text and change the colour.

You can read more and see more examples at https://developer.mozilla.org/en/docs/Web/CSS/Pseudo-elements

like image 194
ᔕᖺᘎᕊ Avatar answered Dec 18 '22 08:12

ᔕᖺᘎᕊ