0
0
CSSmarkup~5 mins

Background size in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the CSS property background-size control?
It controls the size of the background image inside an element, letting you decide how big or small the image appears.
Click to reveal answer
beginner
What does background-size: cover; do?
It makes the background image cover the entire element area, cropping parts if needed, so no empty space is visible.
Click to reveal answer
intermediate
What is the difference between background-size: contain; and background-size: cover;?
contain fits the whole image inside the element without cropping, possibly leaving empty space. cover fills the element fully but may crop the image.
Click to reveal answer
beginner
How can you set a background image to be exactly 100px wide and 50px tall?
Use background-size: 100px 50px; to set the width and height explicitly.
Click to reveal answer
beginner
What happens if you set background-size: auto;?
The background image keeps its original size without scaling.
Click to reveal answer
Which background-size value makes the image fill the element completely, possibly cropping it?
Aauto
Bcontain
Ccover
Dinherit
What does background-size: contain; do?
AScales the image to fit inside the element without cropping
BKeeps the image original size
CRepeats the image to fill the element
DScales the image to fill the element and crop if needed
How do you set a background image size to 50% width and 100% height of the element?
Abackground-size: auto;
Bbackground-size: 100% 50%;
Cbackground-size: cover;
Dbackground-size: 50% 100%;
If you want the background image to keep its original size, which value should you use?
Acover
Bauto
Ccontain
D100% 100%
Which CSS property controls the size of a background image?
Abackground-size
Bbackground-repeat
Cbackground-position
Dbackground-color
Explain how background-size: cover; and background-size: contain; behave differently.
Think about whether the image is cropped or fully visible.
You got /4 concepts.
    Describe how to set a background image to a specific width and height using CSS.
    Remember the syntax: background-size: width height;
    You got /3 concepts.