Skip to content

Courses / CSS3 Mastery: Beginner to Advanced / Flexbox Fundamentals

2,092 people viewed this

Flexbox Fundamentals

Build a navigation bar with a logo on the left and links on the right. Then build a centered card using display: flex, justify-content: center and align-items: center.

Quiz — 10 MCQs

  1. Which declaration enables Flexbox? (A) display: flex (B) position: flex (C) layout: flex (D) float: flex. Answer: A. Display flex establishes a flex formatting context.
  2. What are direct in-flow children of a flex container called? (A) Flex items (B) Grid tracks (C) Floats (D) Pseudo-classes. Answer: A. They become flex items.
  3. What determines the main axis? (A) flex-direction (B) color (C) font-family (D) border-style. Answer: A. The main axis follows flex-direction.
  4. Which property distributes items along the main axis? (A) justify-content (B) align-items (C) text-decoration (D) outline. Answer: A. Justify-content controls main-axis alignment and distribution.
  5. Which property aligns items on the cross axis? (A) align-items (B) justify-content (C) font-weight (D) background. Answer: A. Align-items controls cross-axis alignment.
  6. Which property creates spacing between flex items? (A) gap (B) opacity (C) z-index (D) clear. Answer: A. Gap defines gutters between items.
  7. What is the default flex-direction? (A) row (B) column (C) reverse-column (D) grid. Answer: A. The default direction is row.
  8. Does the main axis remain horizontal when flex-direction is column? (A) Yes (B) No (C) Only with gap (D) Only on desktop. Answer: B. In column direction, the main axis follows the column direction.
  9. Which value distributes free space between items? (A) space-between (B) hidden (C) static (D) italic. Answer: A. Space-between distributes free space between items.
  10. Can Flexbox center an item on both axes? (A) Yes (B) No (C) Only with floats (D) Only with tables. Answer: A. Center alignment on both axes is a common Flexbox pattern.

Key Takeaways

  • Flexbox is a one-dimensional layout system.
  • Understand the main axis and cross axis before using alignment properties.
  • Use gap for clean spacing between items.

Rate this course

No ratings yet — yours can be the first.

Stars show on this course. Your written note stays private.

Your stars