<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Sealyu

    --- 博客已遷移至: http://www.sealyu.com/blog

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      618 隨筆 :: 87 文章 :: 225 評論 :: 0 Trackbacks

    This CSS footer stylesheet will make a footer stick to the bottom of the page. CSS Sticky Footer

    Make the Footer Stick to the Bottom of a Page

    CSS Sticky Footer is Cross-Browser

    There are several ways to make a footer stick to the bottom of a page using CSS. But until now, they've used long and messy hacks or a lot of extra HTML markup; this method uses only 15 lines of CSS and hardly any HTML markup. Even better, it's completely valid CSS, and it works in all major browsers. Internet Explorer 5 and up, Firefox, Safari, Opera and more.

    View the example CSS Sticky Footer.

    How to use this footer on your website

    Add the following lines of CSS to your stylesheet. The negative value for the margin in .wrapper is the same number as the height of .footer and .push. The negative margin should always equal to the full height of the footer (including any padding or borders you may add).

    1. * {
    2.     margin: 0;
    3. }
    4. html, body {
    5.     height: 100%;
    6. }
    7. .wrapper {
    8.     min-height: 100%;
    9.     height: auto !important;
    10.     height: 100%;
    11.     margin: 0 auto -4em;
    12. }
    13. .footer, .push {
    14.     height: 4em;
    15. }

    Follow this HTML structure. No content can be outside of the .wrapper and .footer div tags unless it is absolutely positioned with CSS.

    1. <html>
    2.     <head>
    3.         <link rel="stylesheet" href="layout.css" ... />
    4.     </head>
    5.     <body>
    6.         <div class="wrapper">
    7.             <p>Your website content here.</p>
    8.             <div class="push"></div>
    9.         </div>
    10.         <div class="footer">
    11.             <p>Copyright (c) 2008</p>
    12.         </div>
    13.     </body>
    14. </html>

    Troubleshooting

    Adding margins to elements is messing up the footer.

    Simply use padding instead, and all your worries will go away.

    I put this on my site and it doesn't work right in browser X. You have something wrong with your code!

    Check to see if the example footer page works in that browser. If it does, then you have something wrong with yours!

    I don't know web design. Can you help me with this?

    I charge for website assistance by the hour, and there's a minimum charge of 50 USD. However, there are plenty of CSS and web design forums on the internet where you can get free help. If you really want me to fix it, send me an email and we can discuss pricing.

    The height: auto !important; and height: 100%; properties

    I've been getting about an email a week informing me that the footer works fine without height: auto !important; and height: 100%; in the wrapper selector. This is a min-height hack for IE, so if you want the footer to stick to the bottom of the page in Internet Explorer 6, don't remove it!

    posted on 2009-09-23 09:44 seal 閱讀(229) 評論(0)  編輯  收藏 所屬分類: CSS
    主站蜘蛛池模板: 亚洲精品电影天堂网| 亚洲日韩乱码中文字幕| 24小时日本在线www免费的| 亚洲AV无码国产剧情| 亚洲色欲色欲www| 久草免费福利在线| 91精品国产免费久久久久久青草 | 国产精品久久亚洲不卡动漫| 国产国拍亚洲精品福利 | 国产一区视频在线免费观看| 日本卡1卡2卡三卡免费| 韩国免费a级作爱片无码| 久青草国产免费观看| 久久亚洲国产成人精品性色| 日韩在线视频免费看| 24小时日本在线www免费的| 99无码人妻一区二区三区免费| 日产国产精品亚洲系列| 亚洲人成网站在线播放2019 | 最近2019中文字幕mv免费看| 亚洲AV无码久久精品成人| 亚洲国产美国国产综合一区二区| 亚洲视频免费在线观看| 亚洲视频在线免费观看| 久久精品国产亚洲av日韩| 亚洲综合日韩中文字幕v在线| 亚洲激情在线视频| 亚洲三级视频在线观看| 日韩亚洲人成在线综合| 东北美女野外bbwbbw免费| 亚洲免费精彩视频在线观看| 国内精品久久久久影院免费| 久久国产乱子精品免费女| ww4545四虎永久免费地址| 亚洲一区二区三区无码影院| 91嫩草私人成人亚洲影院| 色天使亚洲综合一区二区| 大地资源在线资源免费观看| 大学生一级特黄的免费大片视频| 亚洲日韩精品无码一区二区三区 | 亚洲成_人网站图片|