i

Learn HTML and CSS in 10 Days

Adding A Background Colour

Setting Backgrounds and Gradients

Backgrounds have a significant effect on the layout of the website. They support in creating the look and feel of a website. In CSS, the background of the element can be an image, solid color, a gradient, or even a composition of all of them. As we choose how to actualize these backgrounds, we should remember that each and every background adds to the general appearance of our site.

This lesson is all about assigning different kinds of backgrounds. We will also be utilizing different CSS3 background properties.

Adding a Background Color

One of the quick ways to provide a background to an element in a web page is by providing a particular color to it by taking the help of the property - background-color or background. The background-color property helps in providing a solid background color to the elements while the background property can take images and color in shorthand form.

div {

background-color: #b2b2b2;

}