Label tags and control groups can be laid horizontally side by side by side by side by adding the .form-horizontal class to the form and using Bootstrap's preset raster classes. Doing so changes the behavior of the .form-group to behave as rows in the raster system, so there is no need to add additional .row.
Horizontal forms are not only different in quantity from other forms, but also in different presentation forms. To create a horizontally laid out form, follow the following steps:
1. Add class .form-horizontal to the parent <form> element.
2. Place the tags and controls in a <div> with class .form-group.
3. Add class .control-label to the label.
Implementation code:
<form role="form"> <div> <label for="inputEmail3">Email</label> <div> <input type="email" id="inputEmail3" placeholder="Email"> </div> </div> <div> <label for="inputPassword3">Password</label> <div> <input type="password" id="inputPassword3" placeholder="Password"> </div> </div> <div> <div> <label> <input type="checkbox"> Remember me </label> </div> </div> </div> <div> <div> <button type="submit">Sign in</button> </div> </div> </form>
If you still want to study in depth, you can click here to learn and attach a wonderful topic to you: Bootstrap learning tutorial
The above is all the content of this article. I hope it will be helpful to everyone's learning and I hope everyone will support Wulin.com more.