bootstrap

Horizontal Form

Horizontal Form

Horizontal forms are distinguished from other forms not just by the amount of markup used, but also by the way the form is presented. Follow these steps to make a form with a horizontal layout:

  • To the parent<form> element, add the.form-horizontal class.
  • Labels and controls should be wrapped in a <div> with the class.form-group.
  • To the labels, apply the.control-label class.
<form class = "form-horizontal" role = "form">
        <div class = "form-group">      
     <label for = "firstname" class = "col-sm-2 control-label">First Name</label>