Hi there, we're going to take pseudo classes to our next level. Okay. We're going to target this second p tag in our testimonials and we're gonna make it smaller. We're going to tap it in and you will notice in our html We haven't applied a class to it because that's what we would have done up until now. Right. We would have gone all right. Peter to go to class. But look, they're just plain old p tags. But somehow in our CSS magically were being able to isolate this using a pseudo class. We do it with our testimonial, we do it with this good looking thing. Every third list item is red pseudo classes. They are the place to be. It's where it's happening, join me in this video and you too can be cool with pseudo classes. Alright, so we learned the real basic pseudo class hover in the last video, but there's lots of other cool things you can do with pseudo classes and the w three schools version of explaining it all can be very dry okay. And and that sometimes is really what I want, but so...
metimes it's good to go and check out something like CSS tricks. Chris square is really good at just giving things a practical application and sometimes it'll say you have to do something according to the manual, but then you're like really and then you come in here and sometimes because it's like, yeah, that's what you meant to do, but it's not what people do. Not only not a regular designers do or developers anyway, this one's pretty good CSS tricks dot com slash pseudo class selectors. Just do a search on his site and it gives you more practical explanations. Now, I'm going to go through them myself because there's lots of this. Okay, but just know that there's more that we can cover in this particular video, It's got a really common one. So we've done those ones. Let's look at these ones. Okay, The position and numbering are really useful because what I'd like to do for our testimonials is this last thing here, this last tag, I would like to make it smaller. Indented a little bit. Where's my mock up? Okay, I want it. Well, that's not, I didn't even do that in my mock up, but I want this smaller push to the right and maybe a tele sized so we can target things like that using pseudo selectors. So let's have a little look. So we're gonna use this one called our first child first and then we'll look at last of type maybe. Okay, so let's jump into our visual studio code. Alright, so start working with the slightly more complicated pseudo classes. Let's look at the first child one because what I'd like to do is I'd like to say style the H one. Okay, Inside of this here box, so what we can do is we can say, okay, inside here a box. Okay. Here, Box one, I'd like to do the um, you know, I'd like to style the first child. Okay. Remember we talked about parents and Children kind of makes a little bit more sense now. Right, Okay. So I want to find the first child and now what you do with it is up here. Can you see? Let's look at an earlier one. So we want to find a P tag inside of cards. We put a space and it's the same with these pseudo classes. I don't want to attach it straight to this. Okay. And do first child. Okay because that's not what I want. What I want to do is find the first child inside of, So just having that space in here. Like we've done earlier for earlier kind of compound classes. I want to find the first child inside a hero box. I'd like to make the color of click. It's weird. Huh? Weird syntax. Don't worry. I find it weird too cool. So I found the first child inside of there. You could say the last child. Okay. It's going to look at here a box and find the last thing in there. And the last thing in there is this button here and it's applied the blue color to the text. So it's going to work for us. Okay. What we want to do is not here a box. We want to find our cards. There we are. And we're going to say I would like inside of tea box T box. I would like to find the last child Because it's the last thing in their last child. That's what I want. Is that what I want? Some better syntax, less curly braces. And let's do font size just make sure it works. So font size, I'm going to turn down to maybe .8 ems rims. Okay, lets save it. Let's have a little look. Did they work? There you go. So I've said the last trial of this um this box here to do this to it. Okay. What I could do as well is if there's more hours is quite simple boxes you can do, let's comment that out. So it's there and we look at a slightly different way because your box that your your div tag might be more complicated than that. So there's other ones in here. Let's have a little look, we'll do length of type A or type, This is a good one. So child is just dealing with whoever is inside the parent and of type. Okay, let's say we want to find the last of type. Okay, and what kind of type? So we're going to say inside of the tee box space because I wanted to be inside tee box, I want you to find the last and not last child will find the last of type. Okay, and what kind of type? I wanted to be the attack, These two get joined. So the last kind of p tag inside of tea box is going to Do the same sort of thing. I'm gonna do font size, font size of 0.8 it means and we'll do a bit of padding on the what side is that? That side is left left, just gonna push it over a little bit. How far I'm going to guess that for the moment. Let's have a little look and old guy is there? Okay, so it is the last of the P type. Okay, we end up at the same place, but you can imagine if you have lots of things afterwards. Okay, after this P tag, maybe there's an image. Okay, our last of the last child is not going to work okay, because that's the last child now, so you can be a little bit more specific with it. Okay. Now again, I'm not going to cover them all because they will have a, I guess their own kind of place. Let's look at maybe just a few more. But what we might do is we might leave that because that's working and I'll leave that there. You can decide which one you want to use. And I'm just going to close this down and create a new document. Alright, what did I do there? I just created like a throwaway document. Right? So there's a new ordered list, which is a bullet pointed list and there's little items inside of it and it looks like this. Okay, so you can play along, you can create this if you want and I'm going to do my styling up in the head tag for the moment. Alright so let's look at some other things. So Let's say that I want to target the 3rd guy down. Just this fella. So what I can do is I can say inside of the U. L. Okay put a space because something inside of it. I would like to target the 10th child. Okay and in the brackets, you type the number you want? So I want to target the third child inside of this fella. Okay, I'm going to put in my curly braces, I'm going to say make you a color of red. We've used too much blue. Okay, so let's give it a test in the browser. There you go. The good thing about it is if I start putting stuff in here air polls I'll speed this up. Alright, that'll do let's save it. Let's have a look. So the oranges red gay. But the thing about it is if I move the order of this will make the orange is the top. Okay, it doesn't really matter actually, you can see banana has now become red. Okay, so it's a great way of targeting it and you can kind of dump stuff onto the page and it doesn't matter. The third person will become red and you can also do instead of just the third child, you can actually say I want the second letter, the letter in afterwards. Okay. It'll be the second version of him and just kind of repeat. Okay. Same. You could put in third, there's lots of other things you can do okay. Um in terms of kind of trying to find specific, you know, you might be dumping loads of data onto a page and you need a style, you know, every 20th row, but only if. Okay. And that's where you might jump into something like chris coy is kind of a bit more. They all kind of dive into nice little examples but I think that's it gives you a good explanation. Okay. The big thing to know though, is that different from our hover class? Often there's a space in between because I want to find the child inside of this thing, but if you want to get real specific, if I want to find the ally, okay, I want to find the nth child only targeting the allies inside of the U. L. This gets joined up. Weird but true. Alright. Do we actually do our uh we did we did we tagged those in, That's what I really wanted to do and that's why we created our testimonials so we could learn a bit more about pseudo classes and if you're like, man that seems like a big what are we doing this for? Because later on in the course we're going to need to know a little bit more about pseudo classes. So it's good kind of foundation for us. It'll make it real easy later on. All right, that is it for this video? I will see it in the next one.