Bootstrap – Floating Labels


Bootstrap – Floating Labels



”;



This chapter will discuss about Bootstrap floating labels. Floating labels refer to form labels that float over the input fields.


Basic example


  • To allow floating labels with Bootstrap”s textual form fields, include a pair of <input class=”form-control”> and <label> elements in .form-floating.

  • Each <input> must have a placeholder since the technique for CSS-only floating labels employs the :placeholder-shown pseudo-element. The <input> needs to be placed first to make use of a sibling selector like (~).