label enables the developer to name an
input field. By default,
label content and the
input field stand separately.
Bootstrap comes with
form-floating to enable floating labels with Bootstrap’s textual form fields.
The following is a step-by-step procedure to create a floating label in bootstrap:
Create a container, for example
div, with the class
input field should have the following:
type — to set the form validation
class = “form-control”
id — which should match the
for attribute in the
forattribute that matches the
input must come before the
Floating labels can also be used with bootstrap’s
Try it yourself for better understanding.
View all Courses