Monday, September 13, 2010

Adding a background pattern

The following CSS can be used to add a patterned, tiled background to your web page:
body {
background: #ffffff url(background-tile.gif);
}
The following screenshot shows a page with a diagonal cross pattern, although you could
alternatively use diagonal stripes, horizontal stripes, squares, or other simple shapes.

 

Note that if you remove many of the paragraphs from the web page, the white background
color ends with the content, since in CSS a container’s size by default only
stretches to that of its content.

No comments:

Post a Comment