What is the use of form-inline Class in Bootstrap ?
Last Updated :
19 Feb, 2024
The .form-inline
class in Bootstrap is used to create horizontally aligned forms. It allows form elements, such as input fields and buttons, to be displayed on the same line, making them suitable for compact layouts, inline form groups, or search bars.
Preview:
Syntax:
<form class="form-inline">
<!-- Form elements go here -->
</form>
Explanation: By applying the .form-inline
class to a <form>
element, Bootstrap styles the form and its child elements to display inline rather than stacked vertically. This class is particularly useful when designing forms that require a more condensed layout or when placing form elements alongside other content on the same line. It helps create a clean and organized appearance for forms while maximizing space efficiency.
Features:
- Allows for the creation of horizontally aligned forms.
- Form elements, such as input fields and buttons, are displayed inline, conserving vertical space.
- Suitable for compact layouts, inline form groups, or search bars.
- Provides a clean and organized appearance for forms, enhancing readability and usability.
- Offers flexibility in designing forms alongside other content on the same line, optimizing layout efficiency.
Ref: https://www.geeksforgeeks.org/bootstrap-5-layout-inline-forms/
Share your thoughts in the comments
Please Login to comment...