How to set a background image for whole webpage? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to set a background image for whole webpage?

I do it in style.css👇 body { background-image:url(by.jpg); } But background image not come Can anyone help me to find another way to set it using HTML5 and css

13th Oct 2019, 10:41 AM
Fathima
2 Answers
+ 6
Hello, in the CSS section, type: body{ background-image:url(image.jpg); no-repeat-center-center:fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; margin:0; padding:0; } if you want the image to be repeated, or type: html{ height: 100%; width: 100%; background: url(image.jpg" ) no-repeat center center fixed; background-size: cover; -webkit-background-size: cover; } if you want the image to be covering the whole page, with no repetition.
13th Oct 2019, 1:38 PM
Elisaveta
Elisaveta - avatar
+ 4
Plz check full html cource and you can eaisly learn from it..
13th Oct 2019, 10:58 AM
🇮🇳Abhay Pratap Singh🇮🇳
🇮🇳Abhay Pratap Singh🇮🇳 - avatar