Open In App

What is the use of form-inline Class in Bootstrap ?

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:

Ref: https://www.geeksforgeeks.org/bootstrap-5-layout-inline-forms/amp/



Article Tags :