CSS
June 3, 2026 2 min read

Master Responsive Web Design with CSS Flex: Flex Containers and Flex Children

HS
HEMANT SINGH
Technical Writer & Educator

In CSS flex is used to create responsive web page design.

Flex container

PropertiesValuesDescription
displayflex 
flex-direction
  • row
  • row-reverse
  • column
  • column-reverse
 
justify-content
  • flex-start
  • flex-end
  • center
  • space-around
  • space-between
 
align-items
  • flex-start
  • flex-end
  • center
  • stretch
  • baseline(item will place like font of items will be align with same base, can be check by providing different font size to the different items)
 

Flex childrens

PropertyDescription 
flex-growDefine how much flex item will grow.itemN{flex-grow:1;}
flex-shrinkDefine how much flex item will shrink.itemN{flex-shrink:0;}Note: By default item size will be the same till the space available, as size of screen reduced, the item size will be shrink as much as possible but when we provide shrink to zero it will not be shrink.
orderChange order of flex item 
flex-basisSpecify initial length of item 
align-selfSpecify alignment for selected item