Bootstrap > Forms

Vertical form in Bootstrap

How to create vertical forms using Bootstrap?


Vertical form

Bootstrap creates forms in vertical, vertical form is a default form 

 <h2><i>Vertical form is a default form</i></h2>
    <form>
        <div class="form-group">
            <label for="email">Email</label>
            <input type="email" class="form-control" id="email" placeholder="Enter email">
        </div>
        <div class="form-group">
            <label for="pwd">Password:</label>
            <input type="password" class="form-control" id="pwd" placeholder="Enter password">
        </div>
        <div class="checkbox">
            <label><input type="checkbox"> Remember</label>
        </div>
        <button type="submit" class="btn btn-danger">Submit</button>
    </form>
  • In the above code snippet we have defined the vertical form
  • In the next line we are having class attribute value as  form-group in the div, we have label value as email and input type as email with class attribute value  as form-control and id as email with placeholder  as Enter email
  • In the next line we are having class attribute value as  form-group in the div, we have label value as Password we have input type as password with class attribute value as form-control, id as pwd and placeholder as Enter password  
  • In the next line we have class attribute value as  checkbox, we have input type as checkbox with value as Remember using label 
  • In the last step we are having button type as submit using btn-danger which creates the button in given color 

output

 Views: 6170 | Post Order: 13



Write for us






Hosting Recommendations