This lesson is exclusive to members

Responsive Web Design Essentials - HTML5 CSS3 Bootstrap

How to make a div tag a giant clickable link in Bootstrap 4

Daniel Walter Scott

Download Exercise Files Download Completed Files



We’re awarding certificates for this course!

Check out the How to earn your certificate video for instructions on how to earn yours and click the available certificate levels below for more information.


I recommend hosting your new website with Bluehost, you can get a big discount by signing up with this link:

You need to be a member to view comments.

Join today. Cancel any time.

Sign Up
All right, you might have been asking for the last, like 30 videos, are we there yet? We are there finally. Got one more little thing to do. We are going to style these blue Primary buttons down the bottom. We're going to make them this nice green color. Let's jump in and work out how to do it now in Bootstrap and VS Code. 

So at the moment, my Card here, the only thing you can click is the button. That's totally fine, but I want to make the entire Card clickable. And Bootstrap has a special Class for that. So under 'Utilities', there's one called Stretched Link. Basically all we need to do is add this, this nice little Class, to the A-tag. It will make the Parent all clickable, apparently. Let's give it a go, so let's grab that, let's go into our Visual Studio Code. Let's find the A-tag, there it is there, inside my Card, and we'll add it to this. 

Let's change the link to go somewhere. So just, I don't know. Not going anywhere, it feels like it-- feels like it shouldn't be. Let's go to any old website, let's save it, and let's give it a go. First up, we've got the Mickey Mouse hand, this one doesn't. See, the Mickey Mouse hand only appears over there. If you don't have the Mickey Mouse hand, different operating systems have different cursors, but there you go, and if I click on it, hey presto, hey, it's me. So really easy, I love that. 

Seems like such a nice easy thing to do. Let's do it for the other links. Let's probably style the Button, and then that's going to be us. Where are we adding it to? This link here, I'm going to go to Primary. We're going to do both these. Let's make sure they work first. Let's get back one. That one works, this one doesn't. Why not, 'Refresh'. Oh, Refresh on that one worked. So sometimes you do need to hit Refresh. We've learned that through the course, right? 

So it's all clickable, let's change this Button, because this Button at the moment has a Hover, which we don't like, and the color is wrong. So we're going to actually, we kind of created our own kind of styles for Primary Outline. We're going to do the same thing for this one here. Just Button Primary, don't want the outline version. So let's make a Class over here, together. A finale, Finale Class, we'll call it. 

We're going to make the background, so the 'bg', actually we'll make the background, 'background-color'. we're going to use, it's color we used before, somewhere; OOBBC9. It's going to give us the green. Let's check it, perfect. We need to change the Hover, because it's still going blue, so we'll make a Pseudo Class. Actually we'll make a Compound and Pseudo Class. Let's go out in a blaze of CSS glory. 

So comma, I want to do this one again, but I want this one to be the ':hover'. So remember, comma separates, so we're doing two separate things, and the separate things happen to be the regular old Primary, plus the Pseudo version of it, where we hover above. Let's check it out, and now, Hover is the same color, waiting for it to change. I didn't pick a different color, I just want it to be the same. 

Let's also work on the Border color here. So 'border-color', we're going to make it the same color as-- can you set it to 'none'? Let's have a little look. Nope, you've got to set it to a color. We could probably turn the size down on it, but we're actually just going to set it to the same color as everything else. There we go, look at us. 

And that is going to be it for our coding together. Hang around for the next video, where we'll discuss your next steps, and of course I'll take your payment details for the Yogurt that you want to order. See you in a sec.