What is code of adding background image in html? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is code of adding background image in html?

22nd Apr 2019, 4:26 PM
Ashraful Aim
Ashraful Aim - avatar
3 Answers
+ 2
Just put your image in same directory where your html file is placed and then write this code, here i have used "image file.jpg" But you may used the name of your image file... Thanks :) <body background="image file.jpg"> </body>
22nd Apr 2019, 4:43 PM
Tahir Iqbal
Tahir Iqbal - avatar
+ 5
You can use CSS for displaying image on your website. body{ background-image: url('path'); background-size: cover; background-repeat: no-repeat; background-position: 50% 50%; }
22nd Apr 2019, 6:41 PM
Mawlood Fareq
Mawlood Fareq - avatar
+ 4
Yes. I got it
22nd Apr 2019, 5:07 PM
Ashraful Aim
Ashraful Aim - avatar