2010-05-05 47 views
1

我希望對我的三列布局有所幫助。 我不滿意右列的行爲,因爲如果瀏覽器沒有最大化,它會影響中心列。 如果瀏覽器變小,右列需要變小,而不是直接剪切中間列。在三列布局中調整右列的行爲


我從this website得到了CSS和我用它爲this index page 我已經try'd調整它,但它是一種混亂。 兩個容器從右側對齊,其他從左側對齊?

我不得不說,這對我來說是一個巨大的痛苦,因爲我需要修理它而不用搞砸佈局的其餘部分。 此外,隱藏的溢出不在右列中工作,因爲文本跳出了?

任何幫助表示讚賞!

這是一些關閉的CSS (除了頁眉和頁腳)

/* column container */ 
.colmask { position:relative; clear:both; float:left; width:100%; overflow:hidden; } 

/* general */ 
.colright, 
.colmid, 
.colleft {float:left;width:100%;position:relative;} 


.col1, 
.col2, 
.col3 {float:left;position:relative;padding:0 0 1em 0;overflow:hidden;} 

.threecol {background:#eee; } 

/* width rightr column*/ 
.threecol .colmid {right:33.4%; background:#fff;} 

/* width center column*/ 
.threecol .colleft {right:33%; background:#f4f4f4; } 

/* width center column content */ 
.threecol .col1 {width:30%; left:101.5%;/*background:#fff004;*/} 

/* width left column content */ 
.threecol .col2 {width:32.2%; left:37.8%; /*background:#fff004;*/} 

/* width right column content*/ 
.threecol .col3 { left:70.8%; /*width:31.9%;*/ /*background:#fff004;*/} 

感謝,理查德

+1

您沒有寬度的'.col3'設置。 – Kyle 2010-05-05 13:32:31

+0

謝謝,這有助於文本溢出。這就解決了一個問題! – Richard 2010-05-05 13:44:32

回答

1

他們都百分比寬度,所以col1格設置爲固定寬度,這應該給你你想要的。

/* width center column content */ 
.threecol .col1 
{ 
    width:400px; 
    margin-right:50px; /*or percentage eqivalent*/ 
left:101.5%; 
/*background:#fff004;*/ 
} 

在Firebug試過,做工精細:)

+0

好吧,我會嘗試 – Richard 2010-05-05 14:40:09

+0

實際工作,謝謝。除了文本溢出失敗,但我會盡力解決這個問題 – Richard 2010-05-05 15:32:16

+0

很高興爲你工作。 – Kyle 2010-05-06 06:43:11