0

Background image size

Hello. Just a quick question: What do I need to do, if I want to have only one background image (background-repeat:no-repeat) and need it to shrink (or expand) to fill the whole element with it? https://code.sololearn.com/WL6TVcJNjRZT/?ref=app

29th May 2018, 3:41 PM
Jan Ơtěch
Jan Ơtěch - avatar
4 Answers
+ 6
background-size:100% 50% where 100% is the background width and 50% background height
29th May 2018, 3:56 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 2
Check this. There are several methods with which you can do that: https://css-tricks.com/perfect-full-page-background-image/
29th May 2018, 3:48 PM
Mickel
Mickel - avatar
+ 1
try using <div> tag because, both background image and background color cant be displayed in your current code
29th May 2018, 4:16 PM
Arinze Obi
Arinze Obi - avatar
0
Thank you all very much.
29th May 2018, 4:20 PM
Jan Ơtěch
Jan Ơtěch - avatar