CSS · Build it
Flexbox (center a div, and more)
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voiceThe interviewer asks
Center a div horizontally and vertically, three ways. Then explain flex: 1, and why my flex item won't shrink below its content.
Then
Follow-ups the interviewer asks next
flex: 1=1 1 0%;flex-basisvswidth.min-width: autoon flex items, and fixing overflow withmin-width: 0.gapvs margins.align-itemsvsalign-contentvsjustify-content.
The answer
What a strong answer covers
- Flex (
justify-contentandalign-items: center), grid (place-items: center), absolute plus transform - Main vs cross axis; wrapping
The red pen
Common traps
Avoid:not knowing the min-width: 0 overflow fix.
Practise this out loud
Say your answer out loud to an AI interviewer that follows up, and get a score for it.
Practise by voicePractise questions like this out loud
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.