XML technologies / CSS / CSS Cookbook / Images / Repeating background images
(Excerpt from “CSS Kochbuch” by Christopher Schmitt)
Problem
You want to repeat background images vertically or horizontally.
Solution
To repeat a background image horizontally, along the x axis, use the following CSS rule (see the next figure):
body {
background-image: url(bkgd.jpg);
background-repeat: repeat-x;
}Figure: The background image is repeated horizontally.
To repeat the background image along the vertical axis, set the property background-repeat to the value repeat-y.
See also
See the recipe Positioning background images for placing a background image at a specific position on a web page.
Copyright of the German edition © 2007 by O’Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “CSS Kochbuch” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstr. 81, 50670 Köln