zoukankan      html  css  js  c++  java
  • 让DIV固定在窗口的底部,不随浏览器滚动

    以下例子为纯CSS制作 ,代码如下:

    <!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>
        <title>固定在页面底部</title>
        <FCK:meta http-equiv="content-type" content="text/html;charset=gb2312" />
        <style type="text/css">
    html, body, div { margin:0; padding:0; border:0; font-size:100%; background:transparent; }
    body { background:#f2f2f2; font:12px 宋体, Verdana, Tahoma, Lucida Grande, Arial, sans-serif; color:#000; }
    #gg { position:fixed; bottom:0; background:#000; 100%; height:23px; line-height:23px; z-index:9999; opacity:.60; 
    filter:alpha(opacity=60); _bottom:auto; _100%; _position:absolute; 
    _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-
    (parseInt(this.currentStyle.marginTop, 10)||0)-(parseInt(this.currentStyle.marginBottom, 10)||0)));
    }
    #gg a { color:#fff; font-size:13px; letter-spacing:2px; }
    </style>
        </head>
        <body>
    <div style="height:2000px;">页面</div>
    <div id="gg">
          <div ><a  target="_blank">底部固定</a> </div>
        </div>
    </body>
    </html>
    
  • 相关阅读:
    弹性盒模型的实际应用
    大图滚动--这是精髓实例
    三级联动
    sql
    jsp2
    marquee
    人机五子棋(AI算法有瑕疵)
    Jsp1
    倒计时
    时间
  • 原文地址:https://www.cnblogs.com/wqing/p/2398336.html
Copyright © 2011-2022 走看看