Bootstrap Tutorial - Set width for input addon








The following code shows how to set width for input addon.

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">
<style type='text/css'>
input {<!--  w w w  .ja  va  2  s . c o m-->
  width: 100%;
}
.input-append {
  width: 95%
}
</style>
</head>
<body>
  <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