Table of Contents
Floating labels are a feature that lets you create simple form labels that stand out above input fields. Here's how to create floating labels in Bootstrap 5.
Floating labels are a feature that lets you create simple form labels that stand out above input fields. Here's how to create floating labels in Bootstrap 5 .
How to Create Floating and Dynamic Labels
By default, when using labels, they usually appear at the top of the input field:
With floating labels, you can insert labels inside input fields, making them float/move when the input field is clicked. Sample code:
For example:

Note on floating labels: Elements must be placed after thetag, and the attribute placeholderis needed for the element (even if it's not visible).
Text Field
It also works with text input areas. Sample code:
Reader Comments 0
Sign in with email or Google to join the discussion.