<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 閱讀(221) 評論(0)  編輯  收藏 所屬分類: CSS
    主站蜘蛛池模板: 8x成人永久免费视频| 亚洲高清一区二区三区电影| 一本久久A久久免费精品不卡 | 亚洲日韩国产二区无码| 四虎成年永久免费网站| 亚洲免费中文字幕| 欧洲一级毛片免费| 亚洲国产日韩综合久久精品| 免费一本色道久久一区| 亚洲精品中文字幕无码A片老| 韩国免费三片在线视频| 国产成人亚洲精品播放器下载 | 亚洲精品第一国产综合亚AV| 麻豆国产VA免费精品高清在线 | 特色特黄a毛片高清免费观看| 亚洲人成网站色在线入口| 三年片免费高清版| 亚洲精品综合一二三区在线| 国内精品免费麻豆网站91麻豆| 亚洲AV色吊丝无码| 日韩免费观看视频| 一级成人生活片免费看| 亚洲va久久久噜噜噜久久狠狠| 亚洲免费视频观看| 欧美色欧美亚洲另类二区| 久久亚洲国产成人影院网站| 久久精品电影免费动漫| 亚洲a级成人片在线观看| 国产免费黄色大片| 国产在线精品免费aaa片| 亚洲中文字幕无码av在线| 全亚洲最新黄色特级网站| a毛片在线免费观看| 亚洲午夜久久久久久尤物| 免费国产高清视频| 可以免费观看的毛片| 亚洲欧好州第一的日产suv| 久久久久亚洲AV综合波多野结衣| 亚洲一区二区免费视频| 免费手机在线看片| 亚洲高清免费在线观看|