Bootstrap Tutorial - Add form control add-on








The following code shows how to add form control add-on.

Example

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.min.css">
</head><!--from   ww  w .ja va 2s  . c  o  m-->
<body style='margin:30px'>
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span8">
        <form class="form-horizontal">
          <div class="control-group">
            <label class="control-label">Field 1</label>
            <div class="controls">
              <input type="text" />
            </div>
          </div>
          <div class="control-group">
            <label class="control-label">Field 2</label>
            <div class="controls">
              <div class="input-append">
                <input type="text" /> <span class="add-on">%</span>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</body>
</html>

Click to view the demo