Hover Color & Animating a Button
Hey there, up until now our button is just sat there, not doing very much, but now watch when I move my mouse over faded in green. Okay, that is called a pseudo class, we're going to use the Sudo Hover, I'll show you how to do it now in Vieques code. All right, currently my button has no hover okay, when I mouse over it I get the kind of mickey mouse hand but I don't get that hover like you saw in the intro, the way to get that is something called a pseudo class because this a tag here has more than one kind of state, it has not been touched state, it has a hover state, it has when I click at ST okay and it has, I've been there before state Okay, those are not the technical words, but you get what I mean, there's a kind of, it does a few different things and you can attack them by creating a pseudo class. The pseudo class works like this, I'm going to do it to my button because that's what I've got applied to this thing, so you create another class and you say my button okay, spell it ...
right. You need, I would like to attack the hover and the way a pseudo class works is that all needs to be joined up and it needs to say that Okay, so I'm going to be attacking the hover the hover state of this button Okay and what are we gonna do? You gonna change the background color. Okay, and I'm gonna pick something my semi colon selected, I'm going to pick probably something a little bit warmer up in here. Alright. And hopefully now when I preview it. Okay I can hover above it. There you go. That is a serious state of hover that I've found and changed. Um you can do, you might have noticed in the intro, I made it fade. Let's do that. So in CSS three we can do a transition. Okay, transition duration. Okay. So it's going to do, how long will do one second. Okay, so it's gonna take one second for this thing to activate. Let's give it a preview. Ready? Oh cool. Now we've looked at the hover state here are other ones. Okay. I'm just showing you w three schools dot com for the different pseudo classes. Okay. And that's the one we've talked about. Let's have a look at their so there's done hover. Okay. That's the main one you're going to do. I never touched visited link or active but it's have a little look just so you know what they are. So at the moment it's red. If you haven't clicked it already clicked it, it's green. Okay, so I visited this so it's green when I mouse over. Its hot pink. So you go that's what we've done the hover and this one here when it's active it goes blue. Watch this when I click it, it goes blue for a second. Okay I never color that because who is gonna see because I click it like this like a normal person super fast and you never see the color change. It's up to you though. You might be loving changing the active color. You can see just the syntax, it's a colon and then these are predefined. It's going to make sure that it's the colon in between. There's lots of other pseudo classes. Okay. Down the bottom of this w three schools, there's a bunch of different ones. Okay. Uh we're going to cover a few more of them in the next video, so yeah, we'll cover the ones that I use anyway, lots of them in here. I have never had a chance to use. Um But yeah, there are lots of pseudo classes outside of just hover. Alright, let's jump into the next video and check a few of them out.