SyntaxStudy
Sign Up
HTML Intermediate 5 min read

Fluid Width Layouts

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.

Example
.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%; }
}
Pro Tip

A simple width: 90% + max-width + margin auto is enough for most responsive containers.