Recipe 3.3. 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 3-5):

body {  background-image: url(bkgd.jpg);  background-repeat: no-repeat;  }             

Figure 3-5. The background image displayed once in the upper-left 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 3.4 for repeating background images in a line either horizontally or vertically.




CSS Cookbook
CSS Cookbook, 2nd Edition
ISBN: 0596527411
EAN: 2147483647
Year: 2006
Pages: 235

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