当我做boostrap时,我必须使用“row”类......
当您查看我的测试设计时:
为什么我被迫使用-30px的margin-left?
使用这个 html,我希望 3 行共享每列 33% 的整个可用宽度:
<div class="container">
<div class="row">
<div style="background-color: pink;" class="span4">
This is a label
</div>
<div style="background-color: violet;" class="span4">
This is a textbox
</div>
<div style="background-color: slateblue;" class="span4">
This is a button
</div>
</div>
<div class="row">
<div style="background-color: orange;" class="span4">
This is a label
</div>
<div style="background-color: orangered;" class="span4">
This is a textbox
</div>
<div style="background-color: yellow;" class="span4">
This is a button
</div>
</div>
<div class="row">
<div style="background-color: seagreen;" class="span4">
This is a label
</div>
<div style="background-color: green;" class="span4">
This is a textbox
</div>
<div style="background-color: lightgreen;" class="span4">
This is a button
</div>
</div>
</div>
带有按钮的灰色区域来自以下代码:
<div style="background-color: gray;">
<div class="pager">
<div class="pull-left">
<a href="#" class="btn" data-bind="css: { disabled: !hasPrevious() }, click: previous">previous</a>
<a href="#" class="btn" data-bind="css: { disabled: !hasNext() }, click: next">next</a>
</div>
<div class="pull-right">
<span data-bind="text: stepNumber()" />
<span>/</span>
<span data-bind="text: stepsLength" />
</div>
</div>
<hr />
<!-- ko compose: { model: activeStep,
transition: 'entrance' } -->
<!-- /ko -->
</div>
为什么当我删除 -30px margin-left 时整个 3 列设计会掉在一起?
我应该如何更改我的代码以真正获得每列具有相同宽度的 3 列布局。这是 span4 应该做的。