我在這樣右浮動的div進入後面左側的div沒有浮動當窗口寬度小於正常
HTML
<div id="commit-header_panel">
<div id="commit-header_panel_right" style="float:right;backg..."></div>
<div id="commit-header_panel_left"></div>
<div style="clear:both;"></div>
</div>
CSS
固定報頭兩個div#commit-header_panel
{
background-color: #c5e8fc;
height:74px;
}
#commit-header_panel_left
{
height:74px;
min-width: 630px;
}
#commit-header_panel_right
{
min-width: 573px;
width:expression(document.body.clientWidth < 573? "573px": "auto");
height:74px;
}
問題是,當我調整窗口的寬度時,右側的div與左側的div相交。
我想要第二個(右邊的浮動)不要落後於左邊的一個。如果需要,右側div應停止向左移動,並讓用戶使用瀏覽器窗口水平滾動條查看右側部分。
問題
使用mediaqueries並定義你的CSS規則取決於瀏覽器的寬度(和避免使用CSS表達式) – fcalderan