<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>div高度占满整个屏幕</title>
<style type="text/css">
.main {
padding: 0;
margin: 0;
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
background: red;
}
</style>
</head>
<div class="main">
</div>
</body>
</html>