What is Flexbox?
Flexbox (Flexible Box Layout) is a CSS module that makes it easier to design flexible responsive layout structures without using float or positioning.
Basic Flex Container
.flex-container {
display: flex;
gap: 1rem;
}
Live Demo
1
2
3
4
5
Responsive Tips
- Use
flex-wrap
to allow items to flow onto new lines on smaller screens. - Combine
flex-basis
withmin-width
for fluid cards. - Leverage media queries to change
flex-direction
fromrow
tocolumn
on narrow viewports.