![](/img/trans.png)
[英]How to distribute evenly a set of same width boxes inside of a bootstrap fluid container?
[英]how to set a div width inside a fluid container element?
我有一個容器元素:
div#container {
width:100%;
height: 20px;
overflow:hidden"
}
這里面的容器,我有漂浮三個子div的left
。 第一個和第三個子div的width = 100px
如何設置第二個div的樣式,使其占用剩余空間?
nb:僅css
,無javascript
。
如果您可以將float:right
移到第三個div,則建議您采用以下布局:
div#container { width:100%; height: 20px; overflow:hidden;display:table; }
div#div1 { float:left; width:100px; display:table-cell; }
div#div2 { margin-left:100px; margin-right:100px; width:100%; display:table-cell; }
div#div3 { float:right; width:100px; display:table-cell; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.