--- title: max-height slug: conflicting/Web/CSS/@viewport_516ab4b0283b5b2231fb657505e22440 tags: - '@viewport' - CSS - CSS Descriptor - Reference translation_of: Web/CSS/@viewport translation_of_original: Web/CSS/@viewport/max-height original_slug: Web/CSS/@viewport/max-height ---
{{CSSRef}}

CSS の max-height 記述子は、{{cssxref("@viewport")}} @-規則で定義された文書のビューポートの最大の高さを指定します。

最大の高さの制約を考慮して、最初の高さは初期ビューポートの高さにできるだけ近い値に設定されます。

{{cssinfo}}

構文

/* Keyword value */
max-height: auto;

/* <length> values */
max-height: 400px;
max-height: 50em;
max-height: 20cm;

/* <percentage> value */
max-height: 75%;

auto
使用する値は他の CSS 記述子の値から計算されます。
<length>
負ではない絶対値または相対値。
<percentage>
垂直方向の長さについて、初期ビューポートの高さである表示倍率1.0 に対するパーセンテージの値。値は負ではない必要があります。

形式文法

{{csssyntax}}

@viewport {
  max-height: 600px;
}

仕様書

仕様書 策定状況 コメント
{{SpecName('CSS3 Device', '#descdef-viewport-max-height', '"max-height" descriptor')}} {{Spec2('CSS3 Device')}} 初期定義

ブラウザー実装状況

{{Compat("css.at-rules.viewport.max-height")}}