Things You'll Need:
- Knowledge of HTML and basic understanding of CSS
-
Step 1
background colorThe code for setting background color to blue for the BODY tag is as follows.
BODY {
background-color: blue;
} -
Step 2
background imageTo set a background image, the following code is used:
BODY {
background-image: url(“css-bg.jpg”)
}
Notice that the default setting is that the image repeats. Note that a shorthand version background: url(“css-bg.jpg”) could be used. -
Step 3
Horizontal repeat of background imageTo repeat the background image horizontally use the following code:
BODY {
background: url("css-bg.jpg") repeat-x
}
repeat-x is placed after the background declaration. -
Step 4
Vertical repeat of background imageTo repeat the background image vertically use the following code:
BODY {
background: url("css-bg.jpg") repeat-x
}
repeat-y is placed after the background declaration.













Comments
tasokjams said
on 6/25/2009 How do you create a css page where each html page has a specific height so that all my pages are looking the same in height and width?