Home | Computer Science

<
CSS background-image

Defination

he background-image property specifies an image to use as the background of an element.


CSS SPACING Syntax of background image is
body {
background-image: url("paper.gif");
}
Some information
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:
Program
INPUT

<html> <head> <style> p { background-image: url("bgdesert.jpg"); color:white; } body { background-image: url("paper.gif"); } </style> </head> <body> <h1>Hello World!</h1> <p>BACKGROUND IMAGE</p> </body> </html>

OUTPUT