Which CSS property controls whether a background image scrolls with the page?
Analysis & Theory
`background-attachment` determines if a background image scrolls with the content or stays fixed.
What does `background-attachment: fixed;` do?
A
Scrolls the image with content
B
Fixes the image to the content
C
Keeps the background image fixed in place while scrolling
Analysis & Theory
`fixed` makes the background image stay in place when the user scrolls the page.
What does `background-attachment: scroll;` do?
A
Fixes the background image to the screen
B
Hides the background on scroll
C
Scrolls the image along with the content
Analysis & Theory
`scroll` is the default value and makes the background move with the page content.
Which is the default value for `background-attachment`?
Analysis & Theory
`scroll` is the default, meaning the background image scrolls with the page.
Which value makes the background image behave like it's stuck to the content?
Analysis & Theory
`scroll` makes the background image move with the content.
What effect does `background-attachment: fixed;` have when combined with `background-size: cover;`?
C
Creates a parallax-like effect
Analysis & Theory
Combining `fixed` with `cover` often creates a parallax scrolling effect.
Which of these is NOT a valid value for `background-attachment`?
Analysis & Theory
`static` is not a valid value for `background-attachment`.
What does `background-attachment: local;` do?
A
Fixes image to viewport
B
Image scrolls within the element
D
Image repeats infinitely
Analysis & Theory
`local` makes the background image scroll with the element's content, not the whole page.
Which tag would commonly use `background-attachment: fixed;` for a parallax effect?
Analysis & Theory
Hero sections often use `background-attachment: fixed;` for visual effects.
Can `background-attachment` be used in the `background` shorthand?
Analysis & Theory
`background-attachment` can be included in the `background` shorthand property.