如何将以下内容保留在一行
<div class="row">
<div class="col-md-12">
<div class="form-check form-check-inline">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1">
Item<asp:TextBox ID="TextBox1" CssClass="form-control input-sm" runat="server"></asp:TextBox>
</label>
</div>
</div>
答案 0 :(得分:1)
将nowrap
类添加到容器中,以查找要在同一行上的元素,然后将此.nowrap
类添加到CSS中。
.nowrap {
white-space: nowrap;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="row">
<div class="col-md-12">
<div class="form-check form-check-inline nowrap">
<label class="form-check-label">
<input class="form-check-input" type="checkbox" id="inlineCheckbox1" value="option1"> Item
<asp:TextBox ID="TextBox1" CssClass="form-control input-sm" runat="server"></asp:TextBox>
</label>
</div>
</div>
&#13;