# max-height

CSS属性 max-height 设置元素的最大高度。它防止height属性的使用值(used value)大于 max-height 的指定值。

# # Syntax

max-height: <length>;

# # Values

fit-content Use the fit-content inline size or fit-content block size, as appropriate to the writing mode.

max-content The intrinsic preferred max-height.

min-content The intrinsic minimum max-height.

auto The browser will calculate and select a max-height for the specified element.

none No limit on the size of the box.

# # default

Platform default
app-uvue none
web none

# # Compatibility

# # uni-app compatibility

Android version Android uni-app Android uni-app-x iOS version iOS uni-app iOS uni-app-x
max-height 5.0 3.9+ 9.0 -
fit-content 5.0 x 9.0 x
max-content 5.0 x 9.0 x
min-content 5.0 x 9.0 x
auto 5.0 x 9.0 x
none 5.0 x 9.0 x

# # See also