2.0 Properties - Colour

The properties used in CSS essentially replace many of the attributes traditionally used inside HTML tags. A good place to start is with the color and background-color properties, which as you can probably guess are used for setting foreground and background colours of elements. For example, to turn some headline text marked by the <h1> tag blue with a red background we would add the following to the syle sheet (for colour hex codes refer to the HTML Tutorial):

h1	{color: blue;
	background-color: red;}

Both of these properties can be applied to other elements. For example, to turn a web page background to yellow we could apply the following to the body tag:

body 	{background: yellow;}

Note that here we have used the compiled background property.