vw/vh的概念
vw是把设备视口宽度均分为100份,每一份就是1vw \
vh是把设备视口高度均分为100份,每一份就为1vh \
vmin/vmax 选取vw/vh中最小/最大的一个
兼容性
在移动端 ios 8 以上以及 Android 4.4 以上获得支持,并且在微信 x5 内核中也得到完美的全面支持
例子
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin: 0;
padding: 0;
}
.header{
position: fixed;
left: 0;
top: 0;
width: 100vw;
height: 50px;
background-color: chartreuse;
}
.contents{
position: fixed;
left: 0;
top: 50px;
width: 100vw;
height: calc(100vh - 50px - 40px);
background-color: brown;
overflow-y: scroll;
}
.footer{
position: fixed;
left: 0;
bottom: 0;
width: 100vw;
height: 40px;
background-color: darkgray;
}
</style>
</head>
<body>
<header class="header">
</header>
<section class="contents">
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
1<br>
2<br>
</section>
<footer class="footer">
</footer>
</body>
</html>
陈泰懿:文章真不错https://www.fcder.cn/zixun/515.html
陈掖缉:文章真不错http://wap.jst-gpmx.cn/news/2208.html
陈踬耱:文章真不错http://wap.jst-gpmx.cn/news/4562.html
陈纸溯:文章真不错https://haodnf.cn/gonglue/20240803/146.html
陈碲黍:文章真不错https://www.iqdyx.cn/news/750.html
jxvkub40965YV-页面设计简洁,阅读体验很棒,没有多余的广告干扰。http://wap.ikaola.xyz//
hnlfat80629IZ-作者的见解深刻,让我受益匪浅,感谢分享。www.well-techmachine.cn/chanpinzhongxin/22.html/