Home

Table of
Contents


Editors

Tags

Text
Formatting


Entities

Links

Frames

Tables

Lists

Forms

Images

Backgrounds

 


A good background can make a Web site look really great.

Backgrounds

The <body> tag has two attributes where you can specify backgrounds. The background can be a color or an image.

Bgcolor

The bgcolor attribute sets the background to a color. The value of this attribute can be a hexadecimal number, an RGB value, or a color name. Example: <body bgcolor="#000000"> <body bgcolor="rgb(0,0,0)"> <body bgcolor="black"> The lines above all set the background color to black.

Background Attributes

The background attribute sets the background to an image. The value of this attribute is the URL of the image you want to use. If the image is smaller than the browser window, the image will repeat itself until it fills the entire browser window. <body background="clouds.gif"> <body background="http://www.w3schools.com/clouds.gif">



Examples

Good background and text color
An example of a background color and a text color that makes the text on the page easy to read.
Bad background and text color
An example of a background color and a text color that makes the text on the page difficult to read.