0
0
CSSmarkup~5 mins

Background position in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the CSS background-position property do?
It sets the starting position of a background image inside an element. You can move the image horizontally and vertically.
Click to reveal answer
beginner
Name two units or keywords you can use with background-position.
You can use keywords like top, center, bottom, left, right, or length units like px, %, em.
Click to reveal answer
beginner
How would you center a background image using background-position?
Use background-position: center; or background-position: 50% 50%; to place the image in the center horizontally and vertically.
Click to reveal answer
beginner
What happens if you use background-position: right bottom;?
The background image will be placed at the bottom right corner of the element.
Click to reveal answer
intermediate
Can background-position accept two values? What do they represent?
Yes, it accepts two values: the first is horizontal position, the second is vertical position. For example, background-position: 20px 30px; moves the image 20 pixels from the left and 30 pixels from the top.
Click to reveal answer
Which CSS property controls where a background image starts inside an element?
Abackground-position
Bbackground-size
Cbackground-repeat
Dbackground-color
What does background-position: center; do?
APlaces the image at the top left
BPlaces the image in the center horizontally and vertically
CRepeats the image in the center
DRemoves the background image
Which of these is a valid background-position value?
Acenter center
Bmiddle middle
Ctop left bottom
Dleft-right
If you want the background image to start 10 pixels from the left and 20 pixels from the top, what is correct?
Abackground-position: 10% 20%;
Bbackground-position: 20px 10px;
Cbackground-position: left 10px top 20px;
Dbackground-position: 10px 20px;
What does background-position: right bottom; do?
APlaces the image at the top right
BPlaces the image at the bottom left
CPlaces the image at the bottom right
DCenters the image
Explain how to use the background-position property to move a background image to the top right corner.
Think about horizontal and vertical keywords.
You got /4 concepts.
    Describe the difference between using percentage values and keyword values in background-position.
    Consider how the image moves inside the element.
    You got /3 concepts.