![]() |
VOOZH | about |
Bootstrap 5 Overview Form Text sits below the form input elements to guide the user on how to fill in the input. Form text can be added to input by using a container(a <div> or a <span>) having the class form-text with the text inside it. If we use a block element for the text the top margin will be automatically added to create space with the input element.
Bootstrap 5 Overview Form Text Classes:
Syntax:
<div class="form-text">
...
</div>
Example 1: In this example, we show how to add form text below inputs using a div as a wrapper.
Output:
Example 2: The below example illustrates how to add inline form text for input. Here we used the <span> element to wrap the form text.
Output:
Reference: https://getbootstrap.com/docs/5.2/forms/overview/#form-text