zoukankan      html  css  js  c++  java
  • css解决无论页面长短footer永远置底

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>footer固定到页面底部</title>
    <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
    <style type="text/css">
    html,body{margin:0;padding:0;height:100%}
    .container{min-height:100%;height:auto !important;height:100%;/*ie6不识别min-height,如上述处理*/position:relative;}
    .header{background:#ff0;padding:10px;}
    .page{960px;margin:0 auto;padding-bottom:60px;/*padding等于footer的高度*/}
    .footer{position:absolute;bottom:0;100%;height:60px;/*footer的高度*/background:#6cf;clear:both;}
    .left{220px;float:left;margin-right:20px;background:lime;}
    .content{background:orange;480px;float:left;margin-right:20px;}
    .right{220px;float:right;background:green;}
    .clearfix:after,
    .clearfix:before{content:"";display:table}
    .clearfix:after{clear:both;overflow:hidden}
    .clearfix{zoom:1;}
    </style>
    </head>
    <body >
    <div class="container">
    <div class="header">这是头部</div>
    <div class="page clearfix">
    <div class="left">left sidebar</div>
    <div class="content">main content</div>
    <div class="right">right sudebar</div>
    </div>
    <div class="footer">footer section</div>
    </div>

    </body>
    </html>



  • 相关阅读:
    js 复杂研究
    js 页面 保持状态 的方法
    C# 向上取整数
    js 获取dom 为null 测试
    net core 下 接受文件 测试
    layui 源码解读(部分)
    js 定时器
    js addEventListener
    C# 获得对象的命名空间 ?.
    修改maven的默认jdk版本
  • 原文地址:https://www.cnblogs.com/xiaotaiyang/p/3835629.html
Copyright © 2011-2022 走看看