CSS Backgrounds
An image to be used as an element’s background is specified using the background-image attribute.
The image fills the full element by default because it is repeated.
Set the background image for a page:
body {
background-image: url("paper.gif");
}
This example shows a bad combination of text and background image. The text is hardly readable:
body {
background-image: url("bgdesert.jpg");
}
Note: When using a background image, use an image that does not disturb the text.
p {
background-image: url("paper.gif");
}
Property | Description |
---|---|
background-image | Sets the background image for an element |
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.