This course has been updated! We now recommend you take the Complete Intro to Web Development, v3 course.
Transcript from the "Pseudo-elements and Wildcard Selector" Lesson
>> Brian Holt: There are pseudoelements which are a little bit more advanced-use case, which I don't really care to get into here too much. But basically if I have like a dev, a great example is this result thing right here. Notice this says like result here, it was a nice way to indicate this is a result of what's up here, right?
[00:00:19] This actually is a pseudo element that I say any time you have this kind of box, put this result thing up here. So this is actually being generated by CSS, it's not actually being generated by HTML. That is done through a pseudoelement, and we can spend a whole bunch of time learning that.
[00:00:37] I don't really care to get into it too much now, but I left you an article if you would like to get into it.
>> Brian Holt: Again, from our good friends at CSS-Tricks, I feel they should pay me at this point. I've said that a lot [LAUGH].
>> Brian Holt: Questions about selectors.
>> Brian Holt: I think I pretty much tell you everything about selectors just in general, or there is one more I'm gonna tell you about that, you should almost never use except always. But before I get into that are there any questions?
>> Brian Holt: Okay, there's one called the wildcard selector.
>> Brian Holt: So I'm just gonna delete these here for just a second, I put *, which means everything. Everything should have this. And I'm gonna say everything should be font-weight bold. Notice everything on my website just became bold.
>> Brian Holt: It's kinda fun, right? That is what the wildcard does for you, it selects literally every element like everything.
[00:02:02] It has specificity of zero, so it's the most easily thing to over ride, but it does select everything. Now, how often should do you use this? Pretty much never. There's once very, very, very specific use case that we're gonna get into here in just a second. You will do this with a box-sizing, border-box.
[00:02:31] I actually put this little snippet of CSS on every single website I develop. Just once, you only need it once. But otherwise never use this wildcard, and we're about to get to what this does, so just ignore it for a second.