Short summary
A compact card still fills the shared row height.
Apply responsive physical and logical width and height utility classes.
Use .w-* and .h-* to set the physical width or height of an element. The
scale uses percentages relative to the containing block and includes auto.
<div class="w-100 h-50">Full width, half height</div>
<div class="w-auto h-auto">Automatic width and height</div>| Pattern | Dimension |
|---|---|
.w-{value}, .h-{value} | Physical width and height. |
.inline-size-{value}, .block-size-{value} | Dimensions along and across the text flow. |
| Suffix | Value |
|---|---|
100 | 100% |
75 | 75% |
60 | 60% |
50 | 50% |
40 | 40% |
30 | 30% |
25 | 25% |
auto | auto |
Use .inline-size-* and .block-size-* when the dimension should follow the
element’s writing mode. inline-size is the text-flow direction and
block-size is perpendicular to it, so these utilities remain correct in right-to-left
and vertical writing modes.
<article class="inline-size-100 block-size-auto">Writing-mode aware content</article>Percentage heights need a containing block with a definite height. Use auto when content should determine the dimension.
The wrapper below uses vertical writing only to make the logical behavior visible. In that mode,
inline-size controls the vertical text-flow direction and block-size
controls the perpendicular dimension.
<div class="inline-size-75 block-size-100" style="writing-mode: vertical-rl;">
Writing-mode aware content
</div>Sizing utilities are mobile-first. Put the breakpoint between the utility name and its scale:
.w-md-50, .h-lg-100, .inline-size-xl-75 or
.block-size-xxl-auto.
<div class="inline-size-100 inline-size-md-75 block-size-auto block-size-lg-50">
Responsive logical sizing
</div>Variants use minimum widths; the later matching breakpoint wins independently of class order. See Breakpoints.
Sizing utilities are useful for responsive content widths, equal-height layouts and dimensions that follow the writing mode instead of the physical screen direction.
This panel uses the full available width on small screens, then becomes narrower at
md and lg. mx-auto keeps the narrower panel centered.
100% → 75% → 50% as the viewport grows.
<div class="w-100 w-md-75 w-lg-50 mx-auto">Responsive content panel</div>In a grid row, h-100 lets cards stretch to the height of the tallest sibling. This
keeps actions and supporting content aligned without hard-coding a pixel height.
A compact card still fills the shared row height.
Both cards remain aligned when one contains more text or a longer action area.
<div class="grid gap-2">
<div class="col-12 col-md-6">
<article class="card h-100">Short summary</article>
</div>
<div class="col-12 col-md-6">
<article class="card h-100">Longer summary</article>
</div>
</div>