0
0
CSSmarkup~20 mins

Align content in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Align Content Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does the CSS property align-content control?
Choose the best description of what the align-content property does in CSS Flexbox or Grid layouts.
AIt controls the alignment of the entire flex or grid container within its parent.
BIt controls the spacing and alignment of multiple rows or columns inside a flex or grid container along the cross axis.
CIt controls the alignment of individual items inside a flex or grid container along the main axis.
DIt controls the text alignment inside flex or grid items.
Attempts:
2 left
💡 Hint
Think about how multiple lines or tracks inside a container are spaced or aligned.
📝 Syntax
intermediate
2:00remaining
Which CSS snippet correctly centers multiple flex lines vertically inside a container?
Given a flex container with multiple wrapped lines, which align-content value centers these lines vertically?
CSS
display: flex;
flex-wrap: wrap;
height: 300px;
Aalign-content: space-between;
Balign-content: flex-start;
Calign-content: center;
Dalign-content: stretch;
Attempts:
2 left
💡 Hint
Centering means equal space above and below the lines.
rendering
advanced
2:00remaining
What will be the vertical spacing between rows with align-content: space-around; in a flex container?
A flex container has multiple wrapped rows. The CSS includes align-content: space-around;. What is the visual effect on the spacing between rows?
CSS
display: flex;
flex-wrap: wrap;
height: 400px;
align-content: space-around;
ARows have equal space above and below each row, including container edges.
BRows are packed at the top with no space between them.
CRows have equal space only between them, but no space at container edges.
DRows stretch to fill the container height with no gaps.
Attempts:
2 left
💡 Hint
Think about how 'space-around' distributes space around each item.
selector
advanced
2:00remaining
Which CSS selector targets only flex containers with multiple wrapped lines to apply align-content?
You want to apply align-content: flex-end; only to flex containers that have wrapped lines (more than one line). Which selector or approach is correct?
A.container[style*='flex-wrap: wrap'] { align-content: flex-end; }
B.container:only-child { align-content: flex-end; }
C.container { align-content: flex-end; }
D.container:has(> *:nth-child(n+2)) { align-content: flex-end; }
Attempts:
2 left
💡 Hint
Use a selector that checks if the container has more than one child element.
accessibility
expert
3:00remaining
How does improper use of align-content affect accessibility in responsive designs?
Consider a flex container with multiple wrapped lines. If align-content is set to stretch without proper height constraints, what accessibility issue might arise on small screens?
AContent may overflow or become clipped, making it hard for keyboard users to navigate.
BText inside flex items will lose semantic meaning, confusing screen readers.
CThe container will ignore user color preferences, reducing contrast.
DFocus outlines will disappear from interactive elements.
Attempts:
2 left
💡 Hint
Think about how stretching content without limits affects layout on small screens.