Recipe 2.4 Setting a Background Image

‚  < ‚  Day Day Up ‚  > ‚  

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(/books/3/26/1/html/2/bkgd.jpg);  background-repeat: no-repeat; } 

Figure 2-9. The background image displayed once in the upper right corner

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.

‚  < ‚  Day Day Up ‚  > ‚  


CSS Cookbook
CSS Cookbook, 3rd Edition (Animal Guide)
ISBN: 059615593X
EAN: 2147483647
Year: 2004
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net