Skip to content
Related Articles

Related Articles

HTML | <body> background Attribute

View Discussion
Improve Article
Save Article
  • Difficulty Level : Easy
  • Last Updated : 28 Mar, 2022
View Discussion
Improve Article
Save Article

The HTML <body> background Attribute is used to specify the background-image for the document. 
Note: It is not supported by HTML5 Instead of using this attribute we use CSS background property. 

Syntax: 

<body background="URL">

Attribute Values: It contains the value i.e URL Which specify the address of the background Image. 
 

  • Absolute URL: It points to another website.
  • Relative URL: It points to a file within a website.

Example: 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>
        HTML body Background Attribute
    </title>
</head>
 
<!-- body tag starts here -->
<body background=
     
    <center>
        <h1>GeeksforGeeks</h1>
        <h2>HTML <body> background Attribute</h2>
         
        <a href="#">
            It is a Computer Science portal For Geeks
        </a>
    </center>
</body>
<!-- body tag ends here -->
 
</html>

Output: 
 

Supported Browsers: The browser supported by <body> background Attribute are listed below: 
 

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Safari
  • Opera

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!