Hi, my name is Dan, and in this video we're gonna look at styling hyperlinks. Now, to understand how to style a hyperlink, we need to understand something called a pseudo class. It's a fancy name, it just means that this tag here, if I select it, it's called the A tag. Okay? And that's to do with my hyperlinks. Now the AAG has a couple of versions.
One is called, um, the active link, which is just sitting there, and there's another one, okay, when a hover above it. And so there's a different style for not hovering and hovering over. And these are called pseudo classes. It just means there's one here called that one where nothing's being touched is called Link. And there's a pseudo class called Hover, and there's a couple of other ones as well. But those are the two main ones you're gonna use.
So now you need to style them in order, you need to do the link first and then the hover, otherwise they get a bit backwards and muddled up. The way I remember it is way I've stolen from, uh, CSS tricks, where love hate is the easiest way to remember it. So you've got link first and then hate, and it's just a, ah, it's just an acronym to help you remember it. So let's do link first. To do it, I am going to, uh, make sure I'm in main css. I'm gonna create a selector.
I'm gonna type in a and a, uh, pseudo class has a colon. And you can see these are all the different pseudo classes. So, and you can see here the visited one. So you can have a different color if a page, if a person's already visited that link and that gets used less and less. There's a hover one that I want. There's all sorts of different ones.
So I want the one that's called Link. Great. I'm gonna click enter and I would like to style the text, and I'd like to make the text white. Great. So all the, um, links, um, that I've got on my website are all now white. The next thing I wanna do is do another pseudo class, which is a colon hover.
Okay? And I want to get rid of this white line underneath the underline, and I would like to change the color of it. Let's do that by making sure we're main do CSS. Let's make a new selector. And this is a colon and we're gonna use hover, right? And the hover one, I want to do a couple things.
I would like to remove the underline, which is appearing. You do that under this one called text. And there's one here called text decoration. And you can see this one here. First one, it says none. So I click that and there's no underline Gone.
Okay, the next thing I wanna do is change the color of it. So I'm gonna be a color. I'm gonna pick a color in here. Click enter. I've just picked a random color, and I want this to be my hover color. Great.
So you've just learned what a pseudo class is. Sounds fancy, but really it's just that there's a tag, which is called a, and it's got some extra little bits, okay. Called these pseudo classes that we can style. Now we've styled our link and our hover, um, and it's gonna style them all. Okay? So it's styled this one and this one.
Now, if you want them to be different, okay, because there's gonna be, um, instances where you don't want them all the, um, links to look the same and say, down here, we wanna make this look a little bit different. If I change this one, obviously this a link here, it's gonna change the top one. So what we're gonna do is Use a class, okay? And we're gonna do a special thing with a class, add a pseudo selected to it. So to do it, we're gonna make a main CSS. We're gonna make a class and we're gonna call this one, uh, uh, footer link.
And we're gonna add the pseudo class afterwards. So, and we're gonna put in a colon and we're gonna put in link. And in this case, actually, I just wanna change the hover of it to make it a little bit special down the bottom. So I'm going to add the pseudo class hover, so it looks a little weird, but is our regular class, and then the little pseudo selector, which is our colon and the hover. So what I'm gonna do now is change it to be, um, when it gets hovered over, I'm gonna change the color to be red. Okay?
So it just means down here. Now, nothing's gonna happen, um, until I add my class. So I'm gonna add the class called, um, footer link. Okay. And when I hover above it, okay, it activates that pseudo class hover all, and you could do it obviously for the link or the hover or any other pseudo selectors, and go around and make lots of different classes for the different kinds of hyperlinks you'd like to see. All right, let's do a save all file, save all, and move on to the next video.