Fluid Layouts
Fluid layouts use percentages or relative units instead of fixed pixels, allowing content to scale naturally with the viewport width.
Combine a fluid width with a max-width to prevent content stretching too wide on large screens.
Fluid layouts use percentages or relative units instead of fixed pixels, allowing content to scale naturally with the viewport width.
Combine a fluid width with a max-width to prevent content stretching too wide on large screens.
.container {
width: 90%; /* Fluid — scales with viewport */
max-width: 1200px; /* Cap at 1200px on large screens */
margin: 0 auto; /* Center horizontally */
}
.column {
width: 100%; /* Full width on mobile */
}
@media (min-width: 768px) {
.column { width: 50%; }
}
A simple width: 90% + max-width + margin auto is enough for most responsive containers.