Jes*_*zie 1 html css twitter-bootstrap-3
如何向我的复选框添加标签,以便将它们内联。
我想要这样的:
label input input
目前下面的代码显示的是input input label为什么?
HTML:
<div class="col-md-6 pull-right">
<div class="form-group">
<label>Gender</label> <label class=
"col-sm-2 checkbox-inline"><input id="genMale" type="checkbox"
value="genMale">Male</label> <label class=
"col-sm-2 checkbox-inline"><input id="genFemale" type=
"checkbox" value="genFemale">Female</label>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
标签gender不在网格内。将类添加col-sm-2到标签中。
<label class="col-sm-2">Gender</label>
Run Code Online (Sandbox Code Playgroud)
这是一个片段:
<label class="col-sm-2">Gender</label>
Run Code Online (Sandbox Code Playgroud)