HTML Background

Color Property

 we want all headlines in a document to be dark red. The headlines are all marked with the HTML element<h1>. The code below sets the color of <h1> elements to red.

Colors can be entered as hexadecimal values as in the example above (#ff0000), or you can use the names of the colors ("red") or rgb-values (rgb(255,0,0)).

The backgroud property.

The element <body> contains all the content of an HTML document. Thus, to change the background color of an entire page, the background-color property should be applied to the <body>element.

You can also apply background colors to other elements including headlines and text. In the example below, different background colors are applied to <body> and <h1> elements.

body { background-color #FF6633

}h1 { color: #990000; background-color #CC0000}

Background-Image

A background image, we use the man picture. You can download the image so you can use it on your own computer (right click the image and choose "save image as"), or you can use another image as you see fit.

To insert the image of the butterfly as a background image for a web page, simply apply the background-image property to <body> and specify the location of the image.

body { background-color: #FFCC66;

background-image:url("man.gif"); }

h1 { color: #990000; background-color: #FC9804; }

Post Comment
Login to post comments