0
0
CSSmarkup~5 mins

Justify content in CSS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the CSS property justify-content do?

justify-content controls how items are spaced along the main axis in a flex or grid container. It helps align items horizontally or vertically depending on the layout direction.

Click to reveal answer
beginner
Name three common values for justify-content and what they do.
  • flex-start: Items align at the start of the container.
  • center: Items are centered in the container.
  • space-between: Items spread out with equal space between them.
Click to reveal answer
intermediate
How does justify-content behave differently in a flex container with flex-direction: row versus flex-direction: column?

In row direction, justify-content aligns items horizontally. In column direction, it aligns items vertically along the container's main axis.

Click to reveal answer
intermediate
What is the difference between space-between and space-around in justify-content?

space-between puts equal space between items but no space at the container edges. space-around adds equal space around all items, so edges have half the space compared to between items.

Click to reveal answer
beginner
Why is justify-content important for responsive design?

It helps control how items adjust their spacing inside flexible containers on different screen sizes, making layouts look balanced and neat on phones, tablets, and desktops.

Click to reveal answer
Which justify-content value aligns items to the center of the container?
Aflex-end
Bflex-start
Ccenter
Dspace-between
What does justify-content: space-between; do?
AAdds equal space around all items including edges
BAligns items at the end of the container
CAligns items at the start of the container
DDistributes items with equal space between them but no space at edges
If a flex container has flex-direction: column;, how does justify-content behave?
AAligns items vertically along the container's main axis
BAligns items horizontally
CHas no effect
DAligns items diagonally
Which justify-content value places all items at the end of the container?
Aflex-start
Bflex-end
Ccenter
Dspace-around
Why should you use justify-content in a flexbox layout?
ATo control spacing and alignment of items along the main axis
BTo change the font size of items
CTo add borders around items
DTo change the background color
Explain how the justify-content property affects the layout of items in a flex container.
Think about how items line up horizontally or vertically depending on flex direction.
You got /3 concepts.
    Describe the difference between space-between and space-around values in justify-content.
    Imagine placing chairs in a row with or without space at the ends.
    You got /3 concepts.