Each layout below uses the same HTML. Switch between Flex and Grid to see how each one handles it, then resize the window. The CSS for the active mode is shown under each demo.
One site, basic stats.
ChooseFive sites, shared editing, custom domains and form submissions sent to your inbox.
ChooseUnlimited sites and client handover.
ChooseSingle sign-on, audit logs and a named contact.
Contact usFree for classrooms.
Apply.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card { flex: 1 1 220px; display: flex; flex-direction: column; }
.card a { margin-top: auto; align-self: flex-start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; }
.card a { align-self: end; justify-self: start; }
.page { display: flex; flex-direction: column; gap: 12px; }
.middle { display: flex; flex-direction: column; gap: 12px; } /* extra wrapper needed */
@media (min-width: 700px) {
.middle { flex-direction: row; }
nav, aside { flex: 0 0 180px; } /* only in row mode: flex-basis follows the main axis */
main { flex: 1; }
}
.page {
display: grid; gap: 12px; grid-template-columns: 1fr;
grid-template-areas: "header" "nav" "main" "aside" "footer";
}
.middle { display: contents; } /* wrapper not needed; ignored */
header { grid-area: header; } nav { grid-area: nav; } main { grid-area: main; }
aside { grid-area: aside; } footer { grid-area: footer; }
@media (min-width: 700px) {
.page {
grid-template-columns: 180px 1fr 180px;
grid-template-areas: "header header header" "nav main aside" "footer footer footer";
}
}
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
label { flex: 0 0 120px; } /* a fixed guess at the longest label */
input { flex: 1 1 200px; }
button { margin-left: 132px; }
.form { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 10px 12px; }
.row { display: contents; }
button { grid-column: 2; justify-self: start; }
/* Justified rows: each item grows in proportion to its aspect ratio */
.gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery li {
flex-grow: calc(var(--w) / var(--h) * 100);
flex-basis: calc(var(--w) / var(--h) * 140px);
aspect-ratio: var(--w) / var(--h);
}
.gallery::after { content: ""; flex-grow: 999; } /* keeps the last row from stretching */
/* Uniform tiles, with some spanning two columns or rows */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
grid-auto-rows: 150px; grid-auto-flow: dense; gap: 8px; }
.gallery li.wide { grid-column: span 2; }
.gallery li.tall { grid-row: span 2; }