Tsallaka zuwa abun ciki
Justice Tech School

flex-grow, flex-shrink and flex-basis

flex-grow shares extra space, flex-shrink shrinks items when space is short and flex-basis sets the starting size. flex: 1 is a common shorthand.

Example
<style>
.f { display: flex; gap: 6px } .f div { background: #0f766e; padding: 8px } .f .g { flex: 1; background: #b45309 }
</style>
<div class="f"><div>fixed</div><div class="g">grows</div><div>fixed</div></div>

Exercise

Fill free space.

flex: ;

Quiz Test

What does flex: 1 do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.