Background image size | Sololearn: Learn to code for FREE!


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?

5/29/2018 3:41:45 PM

Jan Štěch

4 Answers

New Answer


background-size:100% 50% where 100% is the background width and 50% background height


Check this. There are several methods with which you can do that:


try using <div> tag because, both background image and background color cant be displayed in your current code


Thank you all very much.