码迷,mamicode.com
首页 > Web开发 > 详细

CSS解决高度自适应问题

时间:2017-10-06 15:53:32      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:ott   适应   ini   osi   title   device   back   position   width   

<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>

CSS解决高度自适应问题

标签:ott   适应   ini   osi   title   device   back   position   width   

原文地址:http://www.cnblogs.com/shoupifeng/p/7631621.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!