What is Flexbox in CSS?

Answer

CSS Flexbox (Flexible Box Layout) is a one-dimensional layout system for distributing space and aligning items in a row or column. Apply it by setting display: flex on a container element. The key properties are: flex-direction (row or column), justify-content (alignment along the main axis: center, space-between, space-around), align-items (alignment along the cross axis: center, stretch, flex-start), flex-wrap (whether items wrap to the next line), and gap (space between items). Flex items can use flex: 1 to fill available space proportionally. Flexbox excels at one-dimensional layouts like navigation bars and card rows.