HTML background attribute
Example
Specify a background image for the document:
Hello world!
Try it »
Browser support





All major browsers support the background attribute.
Definition and Usage
HTML5 no longer supports the background attribute. Please use CSS instead.
The background attribute was deprecated in HTML 4.01.The background attribute specifies the background image of the document.
Compatibility notes
In HTML 4.01, the background attribute of the body element is deprecated; in XHTML 1.0 Strict DTD, the background attribute of the body element is not supported. Please use CSS instead.
CSS syntax:
CSS example: add a background image to the document
In our CSS tutorial, you can find more details about background-image attributeknowledge.
Syntax
HTML tag