bootstrap

Inline Form

Inline Form

Add the class.form-inline to the <form> tag to make a form with all components inline, left aligned, and labels beside.

<form class = "form-inline" role = "form">
      <div class = "form-group">
      <label class = "sr-only" for = "name">Name</label>
      <input type = "text" class = "form-control" id = "name" placeholder = "Enter Name">
   </div>   

 

  • In Bootstrap, inputs, selections, and textareas have a default width of 100%. When utilising an inline form, you must specify a width for the form controls.
  •  You can hide the labels of inline forms by using the class.sr-only.