純css實現固定底部

來源:互聯網
上載者:User

-------------------------------------------css樣式------------------------------------------------

<style type="text/css">/* 主要部分 */    html, body, #container { height: 100%; margin: 0; padding: 0; }    body > #container { height: auto; min-height: 100%; }   #content { padding-bottom: 60px; }  #footer { clear: both; position: relative; z-index: 10; height: 60px; margin-top: -60px; }/* 樣式部分 */   body { font: .75em/normal "Lucida Sans", "Lucida Grande", sans-serif; }   a, a:link, a:visited { color: #c6762f; text-decoration: underoline; }   p { margin-bottom: 1em; }    #about { padding: 50px;outline:none;}   #footer { background-color: black; color: white; font-size: 200%; text-align: center; line-height: 3em; }</style>


-----------------------------------------------------html--------------------------------------------------------

<div id="container">      <div id="content">             <div id="about" contenteditable='true'>                 <p>可以通過最大化,已最小化的視窗,展開視窗來看本樣本的效果。</p>              </div>    </div></div><div id="footer"> 固定不變的底部</div>
相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.