# height

height CSS 属性指定了一个元素的高度。默认情况下,这个属性决定的是内容区( content area)的高度,但是,如果将 box-sizing 设置为 border-box , 这个属性决定的将是边框区域(border area)的高度。

# # Syntax

height: auto | <length> | <percentage>;

# # Values

fit-content 将 fill-content 公式中的可用位置替换为特定的参数以进行使用,如:min(max-content, max(min-content, ))

max-content 设置为允许的最大高度。

min-content 设置为允许的最小高度。

# # default

Platform default
app-uvue auto
web auto

# # Compatibility

# # uni-app compatibility

Android version Android uni-app Android uni-app-x iOS version iOS uni-app iOS uni-app-x
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

# # See also