Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

what does *::after and *::before mean for universal selector?

?

2 Answers

Maor Tzabari
Maor Tzabari
1,762 Points

Oh, sorry I didn't see that, I'm not familiar with that either, usually * means ALL, but in this case I don't think it does something

Maor Tzabari
Maor Tzabari
1,762 Points

Let's say you have this markup:

<div class="price">534</div>
<div class="price">120</div>
<div class="price">421</div>

and whoever build it forgot to put the dollar sign since it's a price (in my example). instead of putting the dollar 3 times in the HTML, you can define it once if you want it to be before or after:

.price::before{
    content: " $ ";
}

thx q. but for universal (*), what does after and before mean for universal?