1background-image: url("image.png");
2background-position: center;
3background-repeat: no-repeat;
4background-size: cover;
1<!-- Add image by a HTML element: -->
2<div style="background-image: url('img.jpg');">
3
4<!-- Add image by a <style> element: -->
5<style>
6div {
7 background-image: url('img.jpg');
8}
9</style>
10
11<!-- Add to the entire body: -->
12<style>
13body {
14 background-image: url('img.jpg');
15}
16</style>
1<style>
2body {
3 background-image: url('img_girl.jpg');
4 background-repeat: no-repeat;
5 background-attachment: fixed;
6 background-size: cover;
7}
8</style>
1<!-- Background images are better implemented in CSS -->
2<!-- but here is how you could do it in HTML in a pinch -->
3
4<head>
5 <style>
6 .background {
7 background-image: url(https://cleananddelicious.com/wp-content/uploads/2016/03/Avocad0-CD.jpg);
8 }
9 </style>
10</head>
11
12<body>
13 <div class=background>
14 <h1>The background of this div will be an avocado</h1>
15 </div>
16</body>
1<!DOCTYPE html>
2<html>
3 <head>
4 <style>
5 .bg-img {
6 background-image: url("https://cleananddelicious.com/wp-content/uploads/2016/03/Avocad0-CD.jpg");
7 }
8 </style>
9 </head>
10 <body>
11 <div class="bg-img">
12 <h1>The background of this div will be an avocado</h1>
13 </div>
14 </body>
15</html>