Bootstrap Tutorial - Bootstrap Inline form








Inline form

Add .form-inline for left-aligned and inline-block controls for a compact layout.

<!DOCTYPE HTML>
<html> 
<head> 
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
</head><!--from w  w w .  ja v  a2  s.c om-->
<body style='margin:20px;'>
<form class="form-inline">
  <input type="text" class="form-control" placeholder="Email">
  <input type="password" class="form-control" placeholder="Password">
  <div class="checkbox">
    <label>
      <input type="checkbox"> Remember me
    </label>
  </div>
  <button type="submit" class="btn btn-default">Sign in</button>
</form>
</body>
</html>

Click to view the demo