VOOZH about

URL: https://www.geeksforgeeks.org/html/html-body-background-attribute/

⇱ HTML <body> background Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <body> background Attribute

Last Updated : 12 Jan, 2024

The HTML <body> background attribute is used to specify a background image or color for the entire web page's body. You can provide either a URL for an image or a color code to customize the background of the HTML body element.

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 specifies the address of the background Image. 

Attribute Values

Description

Absolute URL

It points to another website.

Relative URL

It points to a file within a website.

Example 1: 

Output: 

👁 Image

Example 2: 

Output:

👁 Screenshot-2024-01-02-090200

Comment
Article Tags: