考虑以下代码:
CSS:
.output {
margin-right:10px;
border:1px solid #000;
}
.box{
border-right:1px solid #000;
}
.first{
border-left:1px solid #000;
}
HTML:
<div class="line">
<div class="output">5</div>
<div class="boxes">
<div class="box first"><span> </span></div>
<div class="box"><span> </span></div>
<div class="box"><span> </span></div>
<div class="box"><span> </span></div>
<div class="box last"><span> </span></div>
</div>
</div>
我希望 div 水平排列并填充 'line' div' (父级的空间),但动态地,例如我不想为每个框指定固定宽度,我只想让它们填满水平空间.
这可以做到吗?