2013-12-09 33 views
0

我有這個Tow欄的頁面佈局||但頁腳是整個文件 如果我想要的頁腳是正確的列下僅此圖像中的黑色註腳頁腳的地方Html css

enter image description here

我試圖昌部分問題

頁腳內容

但它沒有進來,我想

<style> 
    html, body { 
    font-family: Helvetica; 
    height: 100%; /*important for equal height columns*/ 
    } 

    #wrapper{ 
    height: 100%; /*important for equal height columns*/ 
    padding-bottom:60px; /*This must equal the height of your header*/ 
    } 

#header{ 
background-color: #222; 
height: 60px; /*This must equal padding bottom of wrap*/ 
display:block; 
padding: 10px; 
color: #fff; 
} 

#main { 
position: relative; 
height: 100%; /*important for equal height columns*/ 
width: 100%; 
overflow:auto; 
display: table; /* This is needed fo children elements using display table cell*/ 
table-layout: fixed; 
padding-bottom: 80px; /*This needs to match footer height*/ 
overflow: auto; 
} 

#side{ 
background-color: #ccc; 
width: 200px; 
vertical-align: top; 
text-align: center; 
padding: 10px 0; 
display: table-cell; /*To make sibling columns equal in height*/ 
} 

#side-stuff{ 
display: block; 
} 

#content{ 
background-color: pink; 
padding: 20px; 
display: table-cell; /*To make sibling columns equal in height*/ 
} 

#content-stuff{ 
width: auto; 
height: auto; 
} 

#footer{ 
position: relative; 
height: 80px; 
margin-top: -80px; /* margin-top is negative value of height */ 
clear: both; 
background-color: #222; 
color: #fff; 
padding: 10px; 

} 

</style> 



<div id="wrapper"> 
<div id="header"> 
header content 
</div> 

<div id="main"> 

<div id="side"> 
<div id="side-stuff"> 
sidebar stuff 
</div> 
</div> 

<div id="content"> 
<div id="content-stuff"> 
content stuff 
</div> 

</div> 

</div> 
<div id="footer"> 
footer content 
</div> 
</div> 
+0

沒有像我重視 –

回答

1

希望這有助於

<style> 
    #wrapper{ 
    margin:0px auto; 
    padding:0px; 
    width:1000px; 
    } 

    #header 
    { 
    margin:0px; 
    padding:0px; 
    width:1000px; 
    height:100px; 
    background-color:lavender; 
    } 
    #content 
    { 
    margin:0px; 
    padding:0px; 
    width:1000px; 
    } 

    #side 
    { 
    margin:0px; 
    padding:0px; 
    width:250px; 
    height:700px; 
    background-color:grey; 
    float:left; 
    } 
    #main 
    { 
    margin:0px; 
    padding:0px; 
    width:750px; 
    height:700px; 
    float:right; 
    } 
    #main1 
    { 
    margin:0px; 
    padding:0px; 
    width:750px; 
    height:650px; 
    background-color:pink; 
    float:right; 
    } 
    #footer 
    { 
    margin:0px; 
    padding:0px; 
    width:750px; 
    height:50px; 
    background-color:black; 
    float:right; 
    } 

    </style> 
    <div id="wrapper"> 
      <div id="header"> Header </div> 
     <div id="content"> 
      <div id="side">Side</div> 
      <div id="main"> 
       <div id="main1">Main</div> 
       <div id="footer">Footer</div> 
      </div> 
     </div> 
    </div> 
1

放的地方頁腳的一側的DIV中的DIV

<div id="side"> 

    <div id="side-stuff"> 
     sidebar stuff 
    </div> 

    <div id="footer"> 
     footer content 
    </div> 
</div> 
+0

圖片中的黑尾並嘗試使用'底部:0',而不是'保證金-top:-80px' – Ely

+0

thanks alot =)我從你的評論 –

+0

np理解 - 雖然我把頁腳放在你不想讓它成爲的位置:)無論如何,用問題的解決方案更新你的問題,你可以選擇這個作爲你的答案嗎?謝謝。 – Ely