CSS: An Overview
Background color, height, and width

Remember our friend <div>, and how we used it to make those multi-colored blocks? Time for you to build your own blocks! (Well, block. Let's not get ahead of ourselves.)

There are three properties you'll need to set values for:

  1. background-color, which you set to a color or hex value
  2. height, which you set to a value in pixels
  3. width, which is also measured in pixels

These exercises will give you a brief overview of the different HTML elements you can select and what some of their property-value pairs are (like the new ones we mention above). We'll cover HTML element selection more in the next course!


In the stylesheet.css tab:

  1. Set the background-color to #cc0000, like this: background-color: #cc0000;
  2. Set the height to 100px, like this: height: 100px;
  3. Set the width to 100px, as well.
View Preview