【发布时间】:2017-07-05 08:19:19
【问题描述】:
.wrap {
width: 220px;
}
.indi-wrap {
padding-bottom: 10px;
}
.control-label {
display: inline;
font-weight: 300;
}
button.btn-link {
background: 0;
border: 0;
padding: 0;
margin: 0;
}
<div class="wrap">
<div class="indi-wrap">
<input type="checkbox" />
<label class="control-label">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.</label>
<button type="button" class="btn btn-link">only</button>
</div>
<div class="indi-wrap">
<input type="checkbox" />
<label class="control-label">Xonsectetur adipiscing.</label>
<button type="button" class="btn btn-link">only</button>
</div>
<div class="indi-wrap">
<input type="checkbox" />
<label class="control-label">Sed do eiusmod tempor incididunt ut labore.</label>
<button type="button" class="btn btn-link">only</button>
</div>
</div>
注意: 我知道我可以将复选框包装在标签内来解决这个问题,但是从“indi-wrap”类开始,它会自动填充在父级“wrap”中,因此我无法在“indi-wrap”中编辑任何内容。
有什么方法可以将文本标签的第二行与第一行对齐?防止它包裹在复选框下。
【问题讨论】:
-
呃什么?你的代码在哪里?第二行是什么?
-
已编辑,很抱歉我是新来的
-
是的,但问题是我无法编辑“indi-wrap”类中的任何内容,而且我里面有 3 个元素,输入、标签和按钮。标签和按钮是内联的,复选框不应该是内联的。
标签: html css twitter-bootstrap