VOOZH about

URL: https://www.geeksforgeeks.org/bootstrap/bootstrap-5-overview-form-text/

⇱ Bootstrap 5 Overview Form text - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Bootstrap 5 Overview Form text

Last Updated : 23 Jul, 2025

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:

  • form-text: This class adds the help text below or next to the form inputs.

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

Comment

Explore