码迷,mamicode.com
首页 > 其他好文 > 详细

内容始终靠底

时间:2015-09-09 13:29:14      阅读:110      评论:0      收藏:0      [点我收藏+]

标签:

代码结构如下:

<!doctype html>
<html lang="en">
<head>
 <meta charset="utf-8" />
 <title>内容始终位于底部案列</title>
 <style>
 html,body{width:100%;height:100%;margin:0;padding:0;}
 .root{
  height:calc(100% - 30px);
  min-height:500px;
 }
 .root-footer{height:30px;}
 .footer{
  position:relative;
  top:-30px;
  height:30px;
  text-align:center;
 }
 </style>
</head>
<body>
 <div class="root">
  <div class="root-footer"></div>
 </div>
 <div class="footer">这里的内容始终显示在底部</div>
</body>
</html>

内容始终靠底

标签:

原文地址:http://www.cnblogs.com/sj-blogs/p/4794043.html

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