Flexbox — Concept Check
Questions on Flexbox. One-dimensional layout: a row or a column, with control over how the free space is distributed. It is the right tool for components, toolbars and anything that must adapt to its content.
Questions in this quiz
8 questions on Flexbox — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.You have a flex container with multiple items and you notice that the items are not growing to fill the available space. Which property would you adjust to allow the items to grow?
- AApply margin: auto to items
- BSet align-items to stretch
- CSet flex-grow to a positive number
- DUse justify-content: space-around
2.A header is designed with a logo on one side and navigation links on the other. Which flexbox property can you use to ensure the logo and navigation are on opposite ends?
- Aflex-direction: column
- Bjustify-content: space-between
- Cflex-wrap: wrap
- Dalign-items: flex-end
3.You have a flex container set with flex-direction: column. What effect does justify-content: center have on the items?
- ACenters items horizontally
- BAligns items to the top
- CCenters items vertically
- DAligns items to the bottom
4.In a flexbox layout, you notice that a long unbreakable string causes the row to overflow. What property should you adjust to fix this?
- AUse flex-wrap: wrap on the container
- BSet justify-content: flex-start
- CApply align-items: stretch
- DSet min-width: 0 on the flex item
5.A toolbar has multiple buttons and you want the last button to be pushed to the far right. Which approach would achieve this?
- ASet align-items: flex-start
- BUse margin-inline-start: auto on the last button
- CApply flex-direction: column
- DSet justify-content: flex-end
6.You want a card component to have its footer always at the bottom, regardless of the content height. Which flexbox technique should you use?
- AUse justify-content: flex-end
- BSet align-items: center
- CApply flex-direction: row
- DSet margin-block-start: auto on the footer
7.A flex container has items with flex: 1 set. What will happen if you add another item with flex: 2?
- AThe new item will shrink to fit
- BThe new item will not grow
- CAll items will have equal space
- DThe new item will take twice the space of others
8.Which flexbox property is used to control the spacing between flex items along the main axis?
- Aflex-wrap
- Balign-self
- Cjustify-content
- Dalign-items