侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

DIV+CSS让footer始终在底部

2024-05-15 星期三 / 0 评论 / 0 点赞 / 97 阅读 / 2189 字

<!DOCTYPE HTML><html><head><title>test</title><meta http-equiv="content-type" content="text/html; ch

<!DOCTYPE HTML><html><head><title>test</title><meta http-equiv="content-type" content="text/html; charset=utf-8" /><meta name="description" content="" /><meta name="keywords" content="" /></head><style>body,html {    margin: 0;    padding: 0;    font: 12px/1.5 arial;    height: 100%;}#content {    min-height: 100%;    position: relative;}#main {    padding: 10px;    padding-bottom: 60px;}header {    background-color: #AAA;}footer {    position: absolute;    bottom: 0;    background-color: #AAA;    width: 100%;    padding: 10px 0;}footer h1 {    font: 20px/2 Arial;    margin: 0;    padding: 0 10px;}</style><body>    <div id="content">        <header> 头部 </header>        <div id="main">            <h1>hi</h1>            <p>观察footer效果。</p>            <p>asdfsdfsdfsdf</p>            <!-- <script type="text/javascript">                for(var i = 1; i<=155;i++){                    document.write(i + "<br />");                }            </script>-->        </div>        <footer>            <h1>Footer</h1>        </footer>    </div></body></html>

 

广告 广告

评论区