Skip to content
Astera Technology

Explain the gap below an inline box

Compare baseline alignment with bottom alignment inside a fixed line box.

The 32px tile meets the bottom of this 32px line area.

Download complete case notes and answer keys ↓

Inspect the working example

The line uses 16px monospace text with 32px line-height. A32px inline-block tile is bottom-aligned. Its bottom meets the line-box bottom in this fixed specimen.

Inputs and native observations
CaseInput or inspectionResult and meaning
TileMeasure width/height32×32px
Bottom gapParent bottom minus tile bottomApproximately 0px within layout tolerance
Baseline contrastRestore baseline alignmentDescender space produces a positive bottom gap, measured per engine
Download editable CSV ↓

Follow the browser mechanism

Inline boxes participate in a line box and align relative to its baseline by default. Font ascender/descender metrics influence the space below. bottom chooses a different alignment target. Exact baseline-gap pixels are observed per engine, not claimed as a universal constant.

Default baseline alignment leaves font-dependent space

The alternative removes vertical-align:bottom while keeping the tile and line sizes.

Counterexample source; inspect separately
<style>body{margin:8px}</style>
<style>.line{font:16px/32px monospace;background:#e3efe8}.tile{display:inline-block;width:32px;height:32px;background:#23715d}</style><p class="line"><span class="tile"></span></p>

The measured parent bottom is below the tile bottom. Changing parent margins alone does not address that inline baseline relationship.

Try the repair

Should the lesson promise an identical 7px baseline gap on all engines?

Show the worked answer

No. Record the actual positive gap and font metrics for each engine; verify the zero bottom-alignment gap separately.

  • Compare measured bottoms, not just the colored areas.
  • Keep font/line-height assumptions attached to the result.

Original example files

Related resources