CSS Background Image

CSS is the language we use to style an HTML document.
CSS describes how HTML elements should be displayed.
This tutorial will teach you CSS from basic to advanced.
Post Reply
Guest

CSS Background Image

Post by Guest »

CSS Background Image


CSS background-image
The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.

Example
Set the background image for a page: 

body {  background-image: url("paper.gif");}
Try it Yourself »


Example
This example shows a bad combination of text and background image. The text is
hardly readable: 

body {  background-image: url("bgdesert.jpg");}
Try it Yourself »


Note: When using a background image, use an image that does not disturb the text.

The background image can also be set for specific elements, like the <p> element:

Example

p {  background-image: url("paper.gif");}
Try it Yourself »


The CSS Background Image Property


Property
Description


background-image
Sets the background image for an element















+1

Reference: https://www.w3schools.com/css/css_background_image.asp
Post Reply