Build two patterns you will use constantly.
What to build
A bar, a layout row with a sidebar, and cards that wrap.
Requirements
.baris a flex row with items centred across the bar and agapof16px..brandis pushed to the far left, with the links grouped on the right, using anautomargin on.brand..layoutis a flex row where.sidehasflex: 0 0 200px, and.mainhasflex: 1 1 0%..cardswraps, with agapof8px, and each.cardhasflex: 1 1 200px.
Constraints
Do not use grid or floats.
Example
.spacer { margin-left: auto; } pushes that item, and whatever follows it, to the far end.
Why it works
An automatic margin eats up all the spare room. flex-basis gives each card a starting size, wrapping happens when it no longer fits, and growth fills any remaining gap.
Hints
Hint 1
margin-left auto pushes the links to the far side.
Hint 2
flex 1 1 200px means grow, shrink and start at 200px.
Hint 3
A fixed sidebar should not grow or shrink.
Solution
Show one correct solution (try it yourself first)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Flex</title>
<style>
.bar { display: flex; align-items: center; gap: 16px; }
.brand { margin-right: auto; }
.layout { display: flex; }
.side { flex: 0 0 200px; }
.main { flex: 1 1 0%; }
.cards { display: flex; flex-wrap: wrap; gap: 8px; }
.card { flex: 1 1 200px; }
</style>
</head>
<body>
<nav class="bar">
<span class="brand">StepVioz</span>
<a href="/a">One</a>
<a href="/b">Two</a>
</nav>
<div class="layout">
<aside class="side">Side</aside>
<main class="main">Main</main>
</div>
<div class="cards">
<div class="card">A</div>
<div class="card">B</div>
<div class="card">C</div>
</div>
</body>
</html>