2012-07-24 46 views
0

這對我來說很難問。 簡而言之:我的div重疊(超出桌子)。我想要根據div來調整表的大小。使表格大小與div相同

當我試圖添加頁腳時,內容與其重疊。下面是代碼:

這裏是頁:page

回答

0

.middle CSS類設置的中心內容的高度25px因此,頁腳定位與左邊的菜單表的內容。 如果從CSS類中刪除25px股利應按照您希望

+0

嗨,刪除所有的高度,它的工作。謝謝。 – 2012-07-25 08:51:07

0

好吧,我會建議你重寫你的網站,因爲它是一塌糊塗,用我的模板首發:

<div class="wrap"> 
<div class="header"></div> 
<div class="body"> 
    <div class="left-side"></div> 
    <div class="center"></div> 
    <div class="right-side"></div> 
</div> 
<div class="footer"></div> 
</div>​ 

和CSS:

.wrap{ 
    width: 400px; 
    height: 500px; 
    margin: 0 auto; 
} 
.header{ 
    width: 100%; 
    height: 50px; 
    background-color: #dddddd; 
} 
.body{ 
    width: 100%; 
    height: 350px; 
} 
.left-side{ 
    position: relative; 
    float: left; 
    width: 20%; 
    height: 100%; 
    background-color: #eeeeee; 
} 
.center{ 
    position: relative; 
    float: left; 
    width: 60%; 
    height: 100%; 
    background-color: #cccccc; 
} 
.right-side{ 
    position: relative; 
    float: left; 
    width: 20%; 
    height: 100%; 
    background-color: #eeeeee; 
} 
.footer{ 
    width: 100%; 
    height: 100px; 
    background-color: #dddddd; 
} 
​ 

這裏是活生生的例子在jsFiddle

+0

嗨,你確定這將工作得很好時,放到易趣,因爲據我所知它是基於表?感謝您的評論。我不想在自己的服務器上安裝外部CSS和東西。 – 2012-07-25 08:53:24

0

好,@Arturas ..我還挺@skmasq爲您的同意網站。我認爲如果你不使用table進行佈局會更好。但是,如果仍想使用您當前的網站源代碼,請嘗試刪除.middle的高度屬性。因爲你將它設置爲25px,但內容過載,這就是它重疊的原因。

+0

嗨,那麼這不會是一個網站。這是ebay的模板,所以我需要使用表格。但感謝您的建議。 – 2012-07-25 08:50:25