From the course: CSS: Enhancing Website Graphics
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Add background color - CSS Tutorial
From the course: CSS: Enhancing Website Graphics
Add background color
- [Instructor] In the last video we explored how colors can be defined using color names or color values. In this video we'll learn how to apply a color to an element background. Background colors are defined using the CSS background-color property, where the color is either a color name or a color value, using either the RGB or HSL color value system. We'll start with a very basic web page that consists of a single div element with the id main. I want to be able to distinguish the main div element from the page body and the browser window background. Since our html file doesn't contain any text content, remember this is an extremely basic page, I'll visually distinguish the different parts of this web page by setting the background color each web page using the background-color property. We'll put the style rules that define the background colors in the file background.css. In the background.css style sheet file we have no style rules defined yet. So let's start with the style rule…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
CSS colors5m 23s
-
(Locked)
Add background color3m 56s
-
(Locked)
Insert a background image3m 20s
-
(Locked)
Background image options7m 53s
-
(Locked)
Use the background style5m 11s
-
(Locked)
Combine multiple backgrounds7m 26s
-
(Locked)
Challenge: Building a background2m 45s
-
(Locked)
Solution: Building a background2m 13s
-
-
-
-
-
-