2013-07-01 60 views
0

我有一個頁腳和我想它是在使用960網格系統寬度100%,一切都很好,我可以給它使用ID div標籤內工作。但網格一直浮動到頁面的左側,而使用網格的整個網站則集中在頁面上。我嘗試過prefix_2來向右推,但它沒有正確排列。 這是我的代碼開始。100%的寬度頁腳960格

<div id="footer" class="container_12"><img class="prefix_6" id="abs" align="right"  src="#img" width="500" height="258" /> 
<br /><br /> 
<div class="grid_2"><p><a href="#link">Home</a></p><p><a href="#link">Services</a></p><p><a href="#link">Plans</a></p></div> 
<div class="grid_2"><p><a href="#link">Pricing</a></p><p><a href="#link">Design</a></p><p><a href="#link">Logos</a></p></div> 
<div class="grid_2 suffix_6"><p>Call Tool Free:</p><p>1-800-495-5933</p><p><a href="#link">Contact Us</a></p></div> 
<div class="grid_6"><a href="#link"><img src="#img" width="16" height="16" />Follow me on Twitter</a> <img src="#img" width="16" height="16" />Become a Fan on Facebook</div> 
</div> 

CSS:

#footer { 
    background-color: #f0e9d8; 
    font-family: Verdana, Geneva, sans-serif; 
    font-size: 14px; 
    color: #6e2500; 
    font-weight: bold; 
    height: 250px; 
} 
#abs { 
    position: absolute; 
    clip: rect(auto,auto,500px,auto); 
} 
+1

您正在使用什麼框架? –

+0

960電網系統。得到它固定謝謝你們。 – user2539697

回答

0

如果我理解正確的話,你希望那頁腳將是100%的寬度?這是一個簡單的修復。 你只需要一個你的頁腳代碼的另一個包裝。我會做這樣的:

<div id="footer"> 
     <div class="container_12"> 
      <img class="prefix_6" id="abs" align="right"  src="#img" width="500" height="258" /> 
      <br /><br /> 
      <div class="grid_2"><p><a href="#link">Home</a></p><p><a href="#link">Services</a></p><p><a href="#link">Plans</a></p></div> 
      <div class="grid_2"><p><a href="#link">Pricing</a></p><p><a href="#link">Design</a></p><p><a href="#link">Logos</a></p></div> 
      <div class="grid_2 suffix_6"><p>Call Tool Free:</p><p>1-800-495-5933</p><p><a href="#link">Contact Us</a></p></div> 
      <div class="grid_6"><a href="#link"><img src="#img" width="16" height="16" />Follow me on Twitter</a> <img src="#img" width="16" height="16" />Become a Fan on Facebook</div> 
     </div> 
    </div> 

及其產生的CSS將是:

#footer { 
    background-color: #f0e9d8; 
    font-family: Verdana, Geneva, sans-serif; 
    font-size: 14px; 
    color: #6e2500; 
    font-weight: bold; 
    height: 250px; 
    width: 100%; 
    position: relative; 
} 
#abs { 
    position: absolute; 
    clip: rect(auto,auto,500px,auto); 
} 
+0

當我將寬度設置爲100%時,頁腳一直向左傾斜,我想像頁面的其餘部分一樣保持居中。 – user2539697

+0

得到它固定謝謝你們。 – user2539697

0

如果你想在頁腳的寬度爲100%,剛剛從960網格系統中刪除。

<html> 
    <body> 
    <header> 
     Header 
    </header> 
    <section class="container_12"> 
     <!--960 grid--> 
    </section> 
    <footer class="footer-main"> 
     <!--img--> 
    </footer> 
    </body> 
</html> 

CSS

.footer-main { 
    width:100%; 
} 
+0

在container_12中,它不能正確顯示,它保留在該容器內。我需要它佔據該頁面寬度的100%。 – user2539697

+0

明白了,謝謝你們。 – user2539697