css vw和vh单位

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css vw和vh单位相关的知识,希望对你有一定的参考价值。

/*
With vw/vh, we can size elements to be relative to the size of the viewport.
The vw/vh units are interesting in that 1 unit reflects 1/100th the width of the viewport.
To make an element the full width of the viewport, for example, you'd set it to width:100vw.
*/

img { max-height:95vh; }

/*
With rem, we have support across almost all major browsers including IE9.
With vw and vh, however, we still have to wait awhile. Internet Explorer 9 is
the only browser out right now that supports these units.
*/

以上是关于css vw和vh单位的主要内容,如果未能解决你的问题,请参考以下文章

视区相关单位vw, vh ,vm,CSS/CSS3长度时间频率角度单位大全

视区相关单位vw, vh..简介以及可实际应用场景

视区相关单位vw, vh..简介以及可实际应用场景

css px em rem % vw vh vm 区别

视区相关单位vw, vh..简介以及可实际应用场景——张鑫旭

css3自适应布局单位vw,vh,你知道多少?