HTML Background Image

You can display a Background Image in your HTML page by using background attribute of HTML < body > tag. <body background="background.png">

The image you placed in the background of an HTML page will grow or shrink dynamically with the growth and shrinkage of the HTML element they are contained in. Also you may have noticed that background images scroll with the page when you use the scroll bar.

For e.g. Consider the following small image..

background

When we are put this image as a background image of an HTML page it will look like this :

background-image

HTML Source Code :

<html> <body background="background.png"> </body> </html>

Note: The background attribute of HTML < body > is deprecated in HTML 4.01.