From the course: CSS: Scrolling and Parallax

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Adding a background image

Adding a background image - CSS Tutorial

From the course: CSS: Scrolling and Parallax

Adding a background image

- [Instructor] Now that I've explained how backgrounds work, let's go ahead and put everything into action by adding a background into our project. I'm going to also fix one of these little problems. If you remember, I am setting the height of this element right here in our HTML to take up the entire height of the container. So right here, we're saying that the minimum size of this element, which is inside our header, called layout here, or here, so it contains these two things, I'm setting that to be a minimum of 100% of the viewport window. So what that's doing is given us an element that it's the entire height of the page, and let's go ahead and change this thing to something like bg-warning just so that we can see that. Here's our navigation. And if we scroll, you'll see that this element is an entire height of the viewport, no matter what size I make the viewport. So as soon as I scroll up, I'll see my navigation.…

Contents