Browse documentation
Reference / Flexbox & grid
Flex basis
Set the starting size of a flex item along the main axis before the browser distributes free space.
Working example
Colophon
Set in the studio and printed in small runs.
A basis combines with grow and shrink. The final width can differ from the starting size when the row has extra space or runs short.
<div class="flex flex-wrap gap-3 border p-3">
<strong class="basis-24">Colophon</strong>
<p class="min-w-0 grow basis-32">Set in the studio and printed in small runs.</p>
</div>Class reference
| Class | CSS declarations |
|---|---|
basis-0 | flex-basis: 0px; |
basis-24 | flex-basis: 6rem; |
basis-1/3 | flex-basis: 33.33333333333333%; |
basis-1/2 | flex-basis: 50%; |
basis-full | flex-basis: 100%; |
basis-auto | flex-basis: auto; |
basis-[12ch] | flex-basis: 12ch; |
View full generated CSS
.basis-0 {
flex-basis: 0px;
}
.basis-1\/2 {
flex-basis: 50%;
}
.basis-1\/3 {
flex-basis: 33.33333333333333%;
}
.basis-24 {
flex-basis: 6rem;
}
.basis-\[12ch\] {
flex-basis: 12ch;
}
.basis-auto {
flex-basis: auto;
}
.basis-full {
flex-basis: 100%;
}