全屏显示

第1次编辑

元素高度或宽度或二者皆等于屏幕尺寸。

方法1

从html开始,每一级DOM都添加属性height:100%;或width: 100%;

方法2

vw,vh单位

vh unit

Equal to 1% of the height of the initial containing block.

兼容性: 安卓4.4以下不支持。

参考:

http://www.w3.org/TR/css3-values/#viewport-relative-lengths

http://stackoverflow.com/questions/1575141/make-div-100-height-of-browser-window

results matching ""

    No results matching ""