Practice and reinforce the concepts from Lesson 8
justify-content
for horizontal alignmentalign-items
for vertical alignmentflex-direction
, flex-wrap
, and align-content
⏱️ Total Time: 30-40 minutes
In this activity, you will learn about CSS display properties through an interactive game experience. The CSS Flexbox Ducky game will help you understand how to position and align elements using flexbox properties.
:information_source: Game Link: CSS Flexbox Ducky Tutorial
Make sure you complete ALL challenges!
⏱️ Time: 2 minutes
:bulb: Tip The game works best in Chrome or Firefox browsers. If you experience issues, try refreshing the page.
⏱️ Time: 15-20 minutes
justify-content
- Controls horizontal alignmentalign-items
- Controls vertical alignmentflex-direction
- Controls the direction of flex itemsflex-wrap
- Controls whether items wrap to new linesalign-content
- Controls alignment of wrapped lines:bulb: Tip Take your time! If you get stuck on a level, try different property values until you understand how each one affects the layout.
⏱️ Time: 8-10 minutes
As you play through the game, pay special attention to:
justify-content
values:
flex-start
- Items align to the startcenter
- Items center horizontallyflex-end
- Items align to the endspace-between
- Items spread out with space betweenspace-around
- Items have equal space around themalign-items
values:
flex-start
- Items align to the topcenter
- Items center verticallyflex-end
- Items align to the bottomstretch
- Items stretch to fill containerbaseline
- Items align to text baselineDirection and wrapping:
flex-direction: column
changes the axisflex-wrap: wrap
allows items to wrap:bulb: Tip Experiment! Try combining different properties to see how they work together. For example, try
justify-content: center
withalign-items: center
to perfectly center content.
⏱️ Time: 3-5 minutes
Think about how these flexbox properties can be used for:
justify-content: space-between
for evenly spaced menu itemsflex-wrap
for responsive gridsalign-items
to align labels and inputs⏱️ Time: 2-3 minutes
After completing all challenges, consider:
:warning: Warning Important: Complete ALL of the following to receive full credit:
- :white_check_mark: All levels of the CSS Flexbox Ducky game
- :white_check_mark: Understanding of core flexbox properties:
justify-content
align-items
flex-direction
- :white_check_mark: Practice with different property value combinations
- :white_check_mark: Reflection on real-world flexbox applications
- :white_check_mark: Exit ticket submission to demonstrate your learning
Game not loading?
Stuck on a level?
Properties not working as expected?
:bulb: Tip Want to practice more after completing the game? Try these resources: