Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

ic — ideographic font-relative length unit

The ic unit measures lengths using the metrics of the 水 glyph in the font used to render it. It is useful for dimensions based on CJK characters.

Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required

Syntax

<number>ic

ic is a font-relative length unit. 1ic equals the used advance measure of the 水 glyph (U+6C34), not the width of its visible outline. Write the number and unit without a space, for example 10ic.

It approximates CJK character sizing, but does not guarantee that a particular number of arbitrary characters will fit. If determining that measure is impossible or impractical, 1em is assumed. In the example, both bars have identical font settings, so 10ic is twice 5ic; exact pixel values depend on font metrics.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>ic unit comparison</title>
<style>
  .bar {
    font: 20px sans-serif;
    height: 20px;
    margin-block: 8px;
    background: teal;
  }
  .short { width: 5ic; }
  .long { width: 10ic; }
</style>
<div class="bar short"></div>
<div class="bar long"></div>
</html>

Result

Two teal bars; the second is twice as wide as the first when ic is supported. Exact pixel widths depend on font metrics.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources