๐Ÿ“
Websites

CSS Flexbox: the modern web layout tool

20.12.2026
โ† All articles

CSS Flexbox is a one-dimensional (1D) layout technology. It arranges elements horizontally or vertically. Since 2014 it has reshaped web design.

Container and items

display: flex on the parent. Children become flex items.

Main axis and cross axis

flex-direction: row (default), column, row-reverse, column-reverse.

justify-content (main axis)

flex-start, flex-end, center, space-between, space-around, space-evenly.

align-items (cross axis)

stretch (default), flex-start, flex-end, center, baseline.

flex-wrap

wrap โ€” items move to a new line.

Item properties

flex-grow, flex-shrink, flex-basis. Shorthand: flex: 1 0 auto.

order

Changes the order of items.

gap

Space between items without margin tricks.

Nav example

display: flex, justify-content: space-between, align-items: center.

Cards example

display: flex, flex-wrap: wrap, gap, flex: 1 0 300px.

Flexbox vs Grid

Flexbox is 1D. Grid is 2D. Different jobs.

Support

All modern browsers. IE 10+ partial.

Sayt.uz

Header, blog grid, footer use Flexbox. Mobile switches direction via media queries.

Related articles

๐ŸŒพ Agriculture and Agribusiness Website: Product Catalog and B2B Sales โค๏ธ Charity Foundation Website: Transparent Fundraising and Donor Trust ๐ŸŽ‰ Wedding Venue and Banquet Hall Website: Event Planning and Online Booking ๐Ÿš™ Car Rental Website: Vehicle Catalog, Price Calculator, and Online Booking
๐ŸŒ Language
๐Ÿ‡บ๐Ÿ‡ฟ O'zbek ๐Ÿ‡บ๐Ÿ‡ฟ ะŽะทะฑะตะบ ๐Ÿ‡ท๐Ÿ‡บ ะ ัƒััะบะธะน ๐Ÿ‡ฌ๐Ÿ‡ง English โœ“