Bootstrap Form Layout
Bootstrap provides a simple and effective way to create forms on your website. With pre-built classes and components, you can easily create a professional-looking form layout.
Syntax
To create a form layout in Bootstrap, you need to use the following classes:
form-group
: This class is used to group form elements together.form-control
: This class is used to style form elements, such as input fields or textareas.form-label
: This class is used to style form labels.
Here's an example of how to create a simple form with two input fields and a submit button:
<form>
<div class="form-group">
<label for="name">Name:</label>
<input type="text" class="form-control" id="name">
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>