loading

Background Image

CSS background-image

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.

Example

Set the background image for a page:

				
					body {
  background-image: url("paper.gif");
}
				
			

Example

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.

Example

				
					p {
  background-image: url("paper.gif");
}
				
			

The CSS Background Image Property

Property Description
background-image Sets the background image for an element
Share this Doc

Background Image

Or copy link

Explore Topic