CodesJava

Easy learning with example program codes

Bootstrap Inline Form Tutorial

Form act as a container for form elements. All textual input, textarea, and select elements with class .form-control have a width of 100%.

In bootstrap inline form, all of the elements are inline, left-aligned, and the labels are alongside.

Note: This example applies to forms within view ports that are at least 768px wide!

Standard rules for Inline form layouts:
• Wrap labels and form controls in div class=”form-group.
• Add class .form-control to all textual input, textarea, and select elements.
• Add class .form-inline to the

element

Bootstrap Inline Form Example:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Inline Form Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
 
<div class="container">
  <h2>Bootstrap Inline Form Example</h2>
  <form class="form-inline" action="actionName">
    <div class="form-group">
      <label for="email">Email:</label>
      <input type="email" class="form-control" id="email" placeholder="Enter email" name="email">
    </div>
    <div class="form-group">
      <label for="pwd">Password:</label>
      <input type="password" class="form-control" id="pwd" placeholder="Enter password" name="pwd">
    </div>
    <div class="checkbox">
      <label><input type="checkbox" name="remember"> Remember me</label>
    </div>
    <button type="submit" class="btn btn-default">Submit</button>
  </form>
</div>
 
</body>
</html>

Try it:

Bootstrap Inline Form Example on jsbin.com

Please follow and like us:
error

Bootstrap 3 Tutorial








Copyright © 2019 CodesJava DMCA.com Protection Status