Locked lesson.
About this lesson
Exercise files
Download this lesson’s related exercise files.
Backgrounds.docx58.7 KB Backgrounds - Solution.docx
58.8 KB
Quick reference
Backgrounds
Changing background colors and using images as backgrounds is simple with CSS.
When to use
Any time you want to change the background image color, or use an image as a background.
Instructions
To change the background color:
background-color: #cccccc;
To use an image as a background:
background-image: url("hike.png");
Some properties to position background images:
background-repeat: no-repeat;
background-repeat: x;
background-repeat: y;
background-position: left;
background-position: right;
background-position: right top;
background-size: 100%;
Hints & tips
- Change background colors with background-color: #cccccc;
- Use background images with: background-image: url("hike.png");
Lesson notes are only available for subscribers.