在左右填充2%的容器中,我有兩個DIV框。左邊的div框的固定寬度爲200px,固定的margin-right爲60px。我想要正確的div來調整其寬度越小/更大的瀏覽器窗口獲得。我如何實現紅色框的寬度始終(獨立於瀏覽器寬度)填充直到容器的邊距填充開始,而藍色div保持其200px?DIV與固定與DIV的靈活寬度相鄰
的jsfiddle:http://jsfiddle.net/3vhrst19/3/
HTML:
<div id="container">
<div id="fixed-width"></div>
<div id="flexible-width"></div>
</div>
CSS:
#container {
float: left;
width: 100%;
padding: 50px;
background: lightgrey;
}
#fixed-width {
float: left;
width: 200px;
height: 500px;
margin-right: 60px;
background: blue;
}
#flexible-width {
float: left;
width: 500px; /* my goal is that the width always fills up independent of browser width */
height: 500px;
background: red;
}