Rumah >hujung hadapan web >html tutorial >Bootsrtap表单的介绍与应用
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }legend { display: block; width: 100%; padding: 0; margin-bottom: 20px; font-size: 21px; line-height: inherit; color: #333; border: 0; border-bottom: 1px solid #e5e5e5; }label { display: inline-block; margin-bottom: 5px; font-weight: bold; }
<form> <div class="form-group"><label for="exampleInputEmail1">Email address</label><input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email"> </div> <div class="form-group"><label for="exampleInputPassword1">Password</label><input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password"> </div> <div class="form-group"><label for="exampleInputFile">File input</label><input type="file" id="exampleInputFile"><p class="help-block">Example block-level help text here.</p> </div> <div class="checkbox"><label> <input type="checkbox"> Check me out</label> </div> <button type="submit" class="btn btn-default">Submit</button></form>
.form-horizontal
类,并联合使用 Bootstrap 预置的栅格类,可以将 label
标签和控件组水平并排布局。这样做将改变 .form-group
的行为,使其表现为栅格系统中的行(row),因此就无需再额外添加 .row
了
<p> 在