Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

contain-intrinsic-height — substitute intrinsic height

contain-intrinsic-height supplies a substitute inner height for size-contained elements. It neither enables size containment nor replaces the height property.

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

Syntax

contain-intrinsic-height: auto? [ none | <length [0,∞]> ];

contain-intrinsic-height supplies a substitute content size along the physical height axis under size containment. Unlike height, it does not directly impose a height; layout constraints still apply.

Initially none, it is not inherited. It accepts nonnegative lengths, not percentages. Optional auto precedes none or a length: auto 120px uses the last remembered size while contents are skipped, if available; otherwise it uses the fallback. Bare auto is invalid.

The example uses contain: size to demonstrate the effect without scrolling. The expected 120px comes from the substitute size, not the 40px child. This example’s result was verified in an isolated Chromium 157.0.8103.51 environment with external requests blocked.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>contain-intrinsic-height</title>
<style>
  #box {
    contain: size;
    contain-intrinsic-height: 120px;
    width: 200px;
    padding: 0;
    border: 0;
    background: lightblue;
  }
  #box > div { height: 40px; }
</style>
<div id="box"><div>Content</div></div>
<pre id="result"></pre>
<script>
  const box = document.getElementById('box');
  document.getElementById('result').textContent =
    `height: ${box.getBoundingClientRect().height}px`;
</script>
</html>

Result

height: 120px

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