我想要做的是將width: {the rest of width}
設置爲具有float:right
屬性的元素。這裏是我的代碼:如何將餘下的寬度設置爲正確的float元素?
.wrapper{
border: 1px solid;
padding-left: 10px;
}
.fix{
border: 1px solid blue;
width: 80px;
display:inline-block;
}
.rest{
float: right;
border: 1px solid red;
}
<div class='wrapper'>
<div class='fix'> fix width </div>
<div class='rest'> it should has both right float and the rest of width</div>
</div>
我怎麼能填補這一空白?這是預期輸出:
你可以把'寬度:理論值(100% - 80px)''上.rest' – Santi
這似乎是一個完美的時間使用'flexbox'(幾乎所有的瀏覽器支持) – Phil