2011-12-30 119 views

回答

0

把一個包裝div圍繞一切,並適用於height:400px;position:relative;它。然後在藍色div上使用position:absolute;,bottom:0;right:0;

+0

當紅色格擴張中的內容,它不會影響藍色div的定位。 – Aaron 2011-12-30 20:53:59

+0

是的,那麼你想要一個最小高度:400px的包裝div和紅色的div。也許還想要一個溢出:隱藏在包裝div,以保持你的浮動推下包裝... – landons 2011-12-30 21:07:30

0

嗯....

.right-main { 
width: 100px; 
height: 30px; 
clear: both; 
background-color: green; 
} 

清除左格?

因爲一切都是浮動的,我不認爲沒有定位就沒有可能。

那麼有這個... FIDDLE UPDATE

但它確實使用的定位。

+0

這將無法正常工作。我很好地使用定位,我不能想出如何定位符合紅色底部的東西。 – Aaron 2011-12-30 20:55:51

0

試試這個,

.right-main { 
     width: 100px; 
     **height: 400px;** 
     background-color: green; 
    **position: relative;** 
    } 

.bottom-right { 
     background-color: blue; 
     **position:absolute;** 
     **bottom: 0;** 
    }