Form Layout: Bootstrap provides two types of form layout which are listed below:
- Stacked form
- Inline form
Stacked form: The stacked form creates input field and submit button in stacked format.
Inline Form: The .form-inline class is used with <form> element to create inline form. The inline form contains elements that are left-aligned and inline. The inline property applies when viewports are at least 576px wide. If screen size is smaller then 576px then the form element will be stacked vertically.
Inline Form with Utilities: The Bootstrap spacing utilities is used to add space to look better inline form. The .mr-sm-2 class is used to add the right margin to each input on all devices (small and up) and .mb-2 class adds a margin to the bottom.
Form Validation: The .was-validated or .needs-validation class in <form> element is used to provide validation before or after submitting the form. The input field with green border indicate valid and red border indicate invalid form content. The .valid-feedback or .invalid-feedback is used to display a notification message to the user before submitting the form.
- Bootstrap (Part-4) | Vertical Forms, Horizontal Forms, Inline Forms
- Bootstrap 4 | Custom Forms
- Difference between bootstrap.css and bootstrap-theme.css
- Include Bootstrap in AngularJS using ng-bootstrap
- Difference between Bootstrap 4 and Bootstrap 5
- Difference Between Bootstrap 3 and Bootstrap 4
- Semantic-UI | Forms
- CSS | Styling Forms
- ReactJS | forms
- HTML | DOM forms Collection
- How to Create a Pre-Filled forms in Node.js ?
- What's new in Bootstrap v4.3 ?
- Bootstrap 4 | Scrollspy
- Difference Between CSS and Bootstrap
- Bootstrap 5 | Card
- Bootstrap 4 | Typography
- Bootstrap 5 | Carousel
- Bootstrap 4 | Nav-pills
- Bootstrap 4 | Introduction
- Bootstrap 4 | Utilities
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.