2015-10-10 34 views
0

我想製作一個始終位於網頁底部的頁腳。我希望它包含這個頁腳裏面:如何製作頁腳?

<section> 
     <h3><b>AnDeb-Autos</b></h3> 
     <p>07956010151<br> 
     [email protected]<br><br> 
     <b>Post only address because we are mobile van based</b><br><br> 
     Alison Business Centre,<br> 
     40 Alison Crescent<br> 
     Sheffield<br> 
     S2 1AS</p> 
    </section> 
    <section> 
     <h3>Connect with us!<h3> 
     <ul class="social"> 
      <li><a href="#"><img src="FACEBOOK" /></a></li> 
      <li><a href="#"><img src="EBAY" /></a></li> 
      <li><a href="#"><img src="GOOGLEPLUS" /></a></li> 
     </ul> 
    </section> 

我想這是100%的寬和高,因爲它必須以適應一切,我也想它haave的背景顏色黑色,具有不透明性,因此它不那麼堅實。

在你的CSS樣式表

回答

1

添加這些

html { 
    position: relative; 
    min-height: 100%; 
} 

body { 
    margin: 0 0 100px; /* bottom = footer height */ 
    padding: 25px; 
} 

section { 
    position: absolute; 
    left: 0; 
    bottom: 0; 
    height: 100px; 
    width: 100%; 
    overflow:hidden; 
}