您的位置:首页 > Web前端 > CSS

CSS解决高度自适应问题

2017-10-06 15:38 399 查看
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style type="text/css">
html, body {
height: 100%;
margin: 0px;
padding: 0px;
}

#main {
background-color: #E01313;
height: 100%;
}
#nav {
background-color: #85d989;
width: 100%;
height: 50px;
}
#content {
background-color: #cc85d9;
width: 100%;
position: absolute;
top: 50px;
bottom: 0px;
left: 0px;
}
</style>
</head>
<body>
<div id="main">
<div id="nav">nav</div>
<div id="content">content</div>
</div>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: