Backgrounds all around (CSS)

The background property is used to set an image as a background of something, such as the whole page or a div or even a table cell. This is best don using CSS.

Example:

  1. BODY { background: white url(mainBG.gif); }

The background-repeat property specifies how a background image is repeated.

The repeat-x value repeats the image horizontally

The repeat-y value repeats the image vertically.

Example:

  1. BODY { background: white url(mainBG..gif);
  2. background-repeat: repeat-x }

This code will create a background image for the body of your html document that is repeated horizontally across the screen.

This entry was posted on Wednesday, December 6th, 2006 at 11:22 am and is filed under CSS, Getting Started. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

 

Leave a Reply