Home >Web Front-end >HTML Tutorial >Introduction and application of Bootsrtap form
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
class to the form and using Bootstrap's preset grid class, label
labels and control groups can be laid out horizontally side by side. Doing so will change the behavior of .form-group
so that it behaves like a row in a grid system, so there is no need to add an additional .row
<p> Using the class name "form-horizontal" on the