• 页面底部固定于页面底部


    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);
                      }
              });

  • 相关阅读:
    A. k-rounding
    哗啦啦村的刁难(4)
    喵哈哈村的种花魔法
    喵哈哈村的赛马比赛
    喵哈哈村的括号序列
    喵哈哈村的排队
    python中递归调用
    python-中函数的参数
    shell中参数及带色彩打印
    python-文件读写
  • 原文地址:https://www.cnblogs.com/kaixiner/p/3608179.html
Copyright © 2020-2023  润新知