Flexbox Basics
๐ 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-reverseflex-wrapโ nowrap, wrap, wrap-reverseflex-flowโ direction + wrap shorthandjustify-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)