Bootstrap Tutorial - Create Horizontal Form








The following code shows how to create Horizontal Form.

Example

<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-2.0.2.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<script type='text/javascript'
  src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
</head><!--from   w w  w. j  a v a 2s. com-->
<body style='margin:30px'>
  <form class="form-horizontal" role="form">
    <legend class="righter">Legend</legend>
    <div class="form-group">
      <label for="title" class="col-xs-2 control-label">Title</label>
      <div class="col-xs-4">
        <input type="text" class="form-control" id="title" placeholder="..." />
      </div>
    </div>
    <div class="form-group">
      <label for="id" class="col-xs-2 control-label">UUID</label>
      <div class="col-xs-4">
        <input type="text" class="form-control" id="description"
          placeholder="..." />
      </div>
    </div>
  </form>
</body>
</html>

Click to view the demo