Setting background-repeat


Setting background-repeat

The background image in this lesson is now repeating across the screen. This can be controlled using background-repeat.

Values for the background-repeat property (see Figure 6.2) include repeat (where the image is repeated both horizontally and vertically), repeat-x (where the image is repeated horizontally only), repeat-y (where the image is repeated vertically only), and no-repeat (where the image is not repeated).

Figure 6.2. Screenshot of <body> styled with background-repeat.


In this lesson, you will use repeat-y, as shown in Listing 6.4, to force the image to repeat vertically down the page.

Listing 6.4. CSS Code Setting background-repeat
body {     background-image: url(chapter6.jpg);     background-repeat: repeat-y; } 




Sams Teach Yourself CSS in 10 Minutes
Sams Teach Yourself CSS in 10 Minutes
ISBN: 0672327457
EAN: 2147483647
Year: 2005
Pages: 234
Authors: Russ Weakley

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