Line Height

Vertical spacing between lines.

Line height controls the vertical space between lines of wrapped text, and it changes how easy a paragraph is to read.

line-height: 1.6

html

<div class="lh-wrap">
  <p class="lh-text" style="line-height:1.6;font-size:15px;background:#F5C2E055;">Line height controls the vertical space between lines of wrapped text, and it changes how easy a paragraph is to read.</p>
  <p class="lh-caption">line-height: 1.6</p>
</div>
<style>
.lh-wrap { font: 14px/1.5 system-ui, sans-serif; color: #241430; width: 300px; }
.lh-text { margin: 0; padding: 8px; border-radius: 6px; }
.lh-caption { margin: 12px 0 0; font-size: 12px; color: #241430cc; }
</style>

tailwind

<div class="font-sans text-[#241430] w-[300px]">
  <p class="m-0 p-2 rounded-md" style="line-height:1.6;font-size:15px;background:#F5C2E055;">Line height controls the vertical space between lines of wrapped text, and it changes how easy a paragraph is to read.</p>
  <p class="mt-3 text-xs text-[#241430]/80">line-height: 1.6</p>
</div>

react

export function LineHeight({
  lineHeight = 1.6,
  fontSize = 15,
  text = "Line height controls the vertical space between lines of wrapped text, and it changes how easy a paragraph is to read.",
  background = "#F5C2E0",
}) {
  return (
    <div style={{ font: "14px/1.5 system-ui, sans-serif", color: "#241430", width: 300 }}>
      <p style={{ margin: 0, padding: 8, borderRadius: 6, lineHeight, fontSize, background: `${background}55` }}>{text}</p>
      <p style={{ marginTop: 12, fontSize: 12, color: "#241430cc" }}>line-height: {lineHeight}</p>
    </div>
  );
}