實現自適應位置--footer緊貼瀏覽器底部


<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>緊貼瀏覽器底部</title>
<style type="text/css">
* {
        padding: 0;
        margin: 0;
}
html {
        _overflow: auto;/*滾動條*/
}
body {
        _width: expression(this.parentNode.clientWidth);
}
html,
body {
        height: 100%;
}
.section {
        min-height: 100%;
        _height: 100%;/*ie6不識別min-height才加一句這個*/
        padding-bottom: 60px;

  -webkit-box-sizing: border-box;

  -moz-box-sizing: border-box;

  box-sizing: border-box;

}
.footer {
        height: 60px;
        background:#FF6600;
        margin-top: -60px;
        color: #FFF;
}
</style>
</head>
<body>
<div class="section">


</div>
<div class="footer">我這是在底部</div>
</body>
</html>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM