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<!-- Code by Scratchy -->
2<!-- Twitter: @S_cratchy-->
3
4<head>
5 <style>
6 body {
7 background-image: url(https://wallup.net/wp-content/uploads/2019/09/110394-cats-grey-kittens-fluffy-fat-grass-animals-cat-kitten-baby-cute-748x468.jpg)
8 }
9 </style>
10
11 <body>
12 You have set the background image!
13
14
15
16 </body>
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
2 <style>
3body {
4 background-image: url('img_girl.jpg');
5
6 background-repeat: no-repeat;
7 background-attachment: fixed;
8
9 background-size: 100% 100%;
10
11 }
12</style>