Horje
What is HTML Background Images

A background image can be specified for almost any HTML element.

To add a background image on an HTML element, use the HTML style attribute and the CSS background-image property:

 


Full Example of HTML Background Images

Add a background image on a HTML element:
index.html
Example: HTML
<!DOCTYPE html>
<html>
<body>

<h2>Background Image</h2>

<p>A background image for a p element:</p>

<p style="background-image: url('https://itupto.com/uploads/demo/2023-09-09-07-19-13-1.jpg');">
You can specify background images<br>
for any visible HTML element.<br>
In this example, the background image<br>
is specified for a p element.<br>
By default, the background-image<br>
will repeat itself in the direction(s)<br>
where it is smaller than the element<br>
where it is specified. (Try resizing the<br>
browser window to see how the<br>
background image behaves.
</p>

</body>
</html>

Output should be:

Full Example of HTML Background Images
Reffered: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_images_background3





Related Articles
What is HTML Background Images HTML Background Images
How to create Background Image with HTML Style HTML Background Images
How to create Background Image with CSS Style HTML Background Images
How to add HTML Background Image on Full Page HTML Background Images
How to create HTML Background Repeat HTML Background Images
How to create HTML Background with no Repeat HTML Background Images
How to add HTML Background Cover with CSS HTML Background Images
How to create HTML Background Stretch HTML Background Images

Single Articles
Full Example of HTML Background ImagesHTML Background Images

Read Full:
HTML Background Images
Category:
Web Tutorial
Sub Category:
HTML Background Images
Uploaded:
1 year ago
Uploaded by:
Admin
Views:
33



Share on: