Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / CSS

min-height — minimum height

min-height sets a lower bound on an element’s height. When constraints conflict, the minimum takes precedence over height and max-height.

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

Syntax

min-height: auto | <length-percentage [0,∞]> | min-content | max-content | fit-content(<length-percentage [0,∞]>);

min-height constrains physical height from below; it does not set a fixed height. When min-height is a length or percentage, box-sizing determines which box that value applies to. It does not change how intrinsic sizing keywords such as min-content and max-content are interpreted. The property is not inherited.

Lengths and percentages are nonnegative. Percentages reference the containing block’s height; cyclic dependencies require layout-specific rules. none is not valid.

The initial auto usually gives a zero minimum, but layout rules can override this. In column Flexbox, a content-based minimum can prevent an item from shrinking; explicit min-height: 0 removes that constraint.

The example demonstrates minimum precedence: the expected result is 100px, despite smaller height and max-height. The syntax reflects the draft standard, not a claim that Chromium 152 supports every value.

Examples

<!doctype html>
<meta charset="utf-8">
<title>min-height</title>
<style>
  #box {
    box-sizing: border-box;
    height: 40px;
    min-height: 100px;
    max-height: 60px;
    padding: 10px;
    border: 2px solid;
  }
</style>
<div id="box"></div>
<pre id="result"></pre>
<script>
  const box = document.getElementById('box');
  document.getElementById('result').textContent =
    `${box.getBoundingClientRect().height}px`;
</script>

Result

100px

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