From the course: HTML: Images and Figures

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Background images

Background images - HTML Tutorial

From the course: HTML: Images and Figures

Start my 1-month free trial

Background images

- [Instructor] Sometimes you want to put a graphic element in the background of your page to subtly emphasize the point being made in the text. I started creating a page for a fictional travel agency. At the left is the mark up and on the right is what you see in the browser. This looks okay but I want to add a background image. Here's the image I'm going to use for the background of the page. Let's go over to the mark up and add it using CSS. At the top in the Style section of the Body element between lines seven and nine, I'm going to add the background-image property which has a URL of images/travel-globe.png. I'll save that and when I reload in the browser, let's see what that looks like and there's the background image. When you specify a background image, it tiles the background repeating horizontally and vertically to fill the browser window. As you can see, this image is far from being subtle. It's drowning out the text. Let's fix this. I've already prepared a lighter colored…

Contents