Приглашаем посетить
Древнерусская литература (drevne-rus-lit.niv.ru)

Recipe 2.4 Setting a Background Image

Previous Page Table of Contents Next Page

Recipe 2.4 Setting a Background Image

Problem

You want a background image that doesn't repeat.

Solution

Use the background-image and background-repeat properties to control the display of an image (see Figure 2-9):

body {

 background-image: url(bkgd.jpg);

 background-repeat: no-repeat;

}

Figure 2-9. The background image displayed once in the upper right corner
figs/csscb_0209.gif


Discussion

You can place text and other inline images over a background image to create a sense of depth on a web page. Also, you can provide a framing device for the web page by tiling a background image along the sides of a web browser.

See Also

Recipe 2.5 for repeating background images in a line either horizontally or vertically.

    Previous Page Table of Contents Next Page