How to use Background-Image Attribute Inside Body Tag In HTML
In this method, we will add a background image using the background image attribute inside the <body> tag.
Syntax:
<body background="image.png"></body>
Example: Adding the Background on a webpage.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Background Image</title>
</head>
<body background=
"https://media.w3wiki.org/wp-content/cdn-uploads/20210203170945/HTML-Tutorials.png">
<h1 style="color: green;
text-align: center;">
Welcome to w3wiki
</h1>
</body>
</html>
Output:
HTML Background Images
HTML background images are graphics applied to the background of HTML elements, often used in webpage design for aesthetic or branding purposes. They’re set using CSS background-image property, allowing for single or repeating images, gradients, or patterns to enhance visual appeal.
Contact Us