zoukankan      html  css  js  c++  java
  • 页面底部固定于页面底部

    body,html{margin: 0 auto;padding: 0;height:100%;}

    .containt_main{min-height: 100%;_height: 100%;position: relative;}

     <div class="containt_main">

        <div class='footer'  style=' position:absolute;bottom:0;'> </div>

     </div>

    一定要有html的css,containt_main的min-height: 100%;,然后footer:position:absolute;bottom:0;

    页面高度不够的情况下:

    页面放大缩小的时候好像会有问题,该为动态计算高度:$("#main").height($(document).height() - 129 - 104);

    129为top的高度,104为foot的高度。

    最终:

     if($(document).height() - 129 - 104 >  $("#main").height()){
               $("#main").height($(document).height() - 129 - 104);
              }
          $(window).resize(function() {
             if($(document).height() - 129 - 104 > $("#main").height()){
                       $("#main").height($(document).height() - 129 - 104);
                     // alert($(window).height() +' '+$(document).height() + '  '+document.body.scrollHeight +'  '+document.body.clientHeight +'  '+document.body.offsetHeight);
                      }
              });

  • 相关阅读:
    模块的初始
    requests模块的高级用法
    爬虫数据解析方式
    2th
    0
    ..
    .

    1th-绪论
    Py2x & Py3x版本的区别
  • 原文地址:https://www.cnblogs.com/kaixiner/p/3608179.html
Copyright © 2011-2022 走看看