当前位置: 代码迷 >> Web前端 >> 如何使用Sticky Footer代码(让页脚紧贴页面底部的方法)
  详细解决方案

如何使用Sticky Footer代码(让页脚紧贴页面底部的方法)

热度:195   发布时间:2012-06-28 15:20:03.0
怎么使用Sticky Footer代码(让页脚紧贴页面底部的方法)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
<html xmlns="http://www.w3.org/1999/xhtml">  
    <head>  
        <title></title>  
        <meta http-equiv="content-type" content="text/html; charset=UTF-8" />  
        <style type="text/css">  
            html,body{  
                height:100%;  
            }  
            body{  
                width:980px;  
                margin:0 auto;  
            }  
            .lastChild{  
                margin-bottom:0;  
            }  
            .firstChid{  
                margin-top:0;  
            }  
            h1{  
                text-align:center;  
            }  
            .wrapper{  
                height:auto !important;  
                min-height:100%;  
                height:100%;  
                margin:0 auto -85px;  
            }  
            .wrapper .content{  
                padding-bottom:85px;  
            }  
            .copyRight{  
                background:#457FCC;  
                height:100%;  
            }  
            .footer{  
                height:85px;  
                margin:-85px 0 0;  
            }  
        </style>  
    </head>  
    <body>  
        <div class="wrapper">  
            <div class="content">  
                <h1 class="firstChid">Sticky footer</h1>  
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>  
                <p class="lastChild">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>  
            </div>  
        </div>  
        <div class="footer">  
            <p class="copyRight lastChild firstChid">this is the copy right part</p>  
        </div>  
    </body>  
</html>  
?

?

  相关解决方案