XML technologies / CSS / CSS Cookbook / Images / Non-repeating background images
(Excerpt from “CSS Kochbuch” by Christopher Schmitt)
Problem
You want to use a background image without repeating it.
Solution
Use the properties background-image and background-repeat to control the background image’s display (see the next figure):
body {
background-image: url(bkgd.jpg);
background-repeat: no-repeat;
}Figure: The background image appears only once in the top-left corner.
Discussion
You can place text and other embedded images over a background image to give a web page a sense of depth. Repeating the image along the edges of the browser window, on the other hand, can give a web page a frame.
See also
The recipe Repeating background images for repeating background images vertically or horizontally.
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