How to make background-image 100%.? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

How to make background-image 100%.?

When I apply background-image in my web page the background is not fully cover the whole page

22nd Jul 2017, 5:41 PM
Dodz Contemplo
Dodz Contemplo - avatar
4 Answers
+ 16
background-size:cover;
22nd Jul 2017, 5:53 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 7
thanks idol😇
22nd Jul 2017, 5:56 PM
Dodz Contemplo
Dodz Contemplo - avatar
+ 6
Play with this properties: body{ background-image: url('http://via.placeholder.com/350x150'); /* background-color: #999; */ background-size: 100%; /* background-repeat: no-repeat; */ /* background-position: 0 0; */ }
22nd Jul 2017, 6:00 PM
Вап
0
You may construct a background from img. Make it position:absolute and left:0; top:0 right:0 It actually depends on how adaptive would your design be.
15th Aug 2017, 6:24 PM
Anatoly Sheljag
Anatoly Sheljag - avatar