html如何适配设备高度,高度 | @viewport.height

高度 | @viewport.height

heightCSS描述符是同时设置一个速记描述符min-height和max-height视口。通过提供一个视口长度值将把所提供的值设置为最小高度和最大高度。

如果提供了两个视口值,则第一个值将设置最小高度,第二个值将设置最大高度。

Related at-rule

@viewport

初始值

as each of the properties of the shorthand: min-height: 0 max-height: none

Percentages

as each of the properties of the shorthand: min-height: The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as 0. max-height: The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as none.

适用媒体

visual, continuous

计算值

as each of the properties of the shorthand: min-height: the percentage as specified or the absolute length max-height: the percentage as specified or the absolute length or none

正规顺序

order of appearance in the formal grammar of the values

min-height:0

max-height:none

Percentages as each of the properties of the shorthand:

min-height:百分比是根据生成的包含块的框%27s的高度计算的。如果未显式指定包含块的高度%28i。e.它取决于内容高度%29,并且该元素不是绝对定位的,百分比值被视为0。

max-height:百分比是根据生成的包含块的框%27s的高度计算的。如果未显式指定包含块的高度%28i。e.它取决于内容高度%29,并且该元素不是绝对定位的,百分比值被视为none。

Media visual, continuous [Computed value](../computed_value) as each of the properties of the shorthand:

min-height:指定的百分比或绝对长度

max-height:指定的百分比或绝对长度或none

Canonical order order of appearance in the formal grammar of the values

语法

/* One value */

height: auto;

height: 320px;

height: 15em;

/* Two values */

height: 320px 200px;

auto使用的值是从其他CSS描述符的值中计算出来的。非负的绝对或相对长度。相对于初始视口宽度或高度的缩放因子1.0的百分比值,分别为水平和垂直长度。必须是非负的。

正式语法

{1,2}where

= auto |

where

= |

示例

@viewport {

height: 500px;

}

规范

Specification

Status

Comment

CSS Device AdaptationThe definition of '"height" descriptor' in that specification.

Working Draft

Initial definition

浏览器兼容性

Feature

Chrome

Firefox (Gecko)

Internet Explorer

Opera

Safari

Basic support

29 (behind a flag)

No support

10 -ms

11.10 Removed in 15 Reintroduced behind a flag in 16

No support

Feature

Android

Chrome for Android

Firefox Mobile (Gecko)

IE Mobile

Opera Mobile

Safari Mobile

Basic support

4.4

29

No support

10-ms

11.10 Removed in 15 Reintroduced behind a flag in 16

No support

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值