<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>CSS实现div的全屏自适应显示(两种方案)</title>
<style type="text/css">
html, body {padding: 0; margin: 0; height: 100%; overflow:hidden;}
.m-demo {height: 100%;background: #666666;}
.m-demo2 {position: absolute; height: 100%; width: 100%; top: 0px; bottom: 0px;overflow:hidden; word-break:break-all;background: green;}
</style>
</head>
<body>
<div></div>
<div></div>
</body>
</html>
CSS实现div的全屏自适应显示(两种方案)
内容版权声明:除非注明,否则皆为本站原创文章。