Flexbox Basics

๐ŸŽจ CSS3+ ๐ŸŸข Chapter 21 of 49 ๐Ÿ“‚ Phase 08: Flexbox ๐Ÿ“… 2026 Edition
๐Ÿ“Œ Covered in this chapter: Flexbox Definition ยท Container ยท Items ยท Main Axis ยท Cross Axis ยท display:flex ยท flex-direction ยท flex-wrap ยท gap ยท justify-content ยท align-items ยท align-content
Welcome to Chapter 21: Flexbox Basics โ€” part of the CSS Complete Roadmap. This lesson covers all subtopics with clear explanations, code examples, and best practices used in professional web development.
1Flexbox Ante Enti?

Flexbox ante enti? Flexbox one-dimensional layout model โ€” items ni row or column direction lo arrange and align cheyyadaniki optimized. Main axis along flow, cross axis perpendicular.

Flex container lo direct children flex items avuthayi.

2Flex Container Properties
CSS โ€” Navbarโ–ถ Try in Editor
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
  • flex-direction โ€” row (default), column, row-reverse, column-reverse
  • flex-wrap โ€” nowrap, wrap, wrap-reverse
  • flex-flow โ€” direction + wrap shorthand
  • justify-content โ€” main axis alignment (flex-start, center, space-between, space-around)
  • align-items โ€” cross axis alignment (stretch, center, flex-start, flex-end)
  • align-content โ€” multi-line cross axis (when wrap enabled)
  • gap โ€” space between items (modern, margin hacks avoid)
OC
Written by Our Compiler Technical Editorial Team
Reviewed for accuracy ยท CSS Complete Roadmap ยท Last updated August 2026