Bootstrap 3: Legen Sie benutzerdefinierte Breite mit input-group/input-group-addon und horizontale Beschriftungen

Ich würde gerne die Größe meiner input-Elemente mit der Klasse .col-lg-* skizziert hier auf der bootstrap-website. Allerdings setzen die <span> - element innerhalb eines div-völlig Durcheinander it up:

HTML mit div:

<div class="input-group input-group-lg">
  <label for="" class="control-label">Paycheck</label>
  <div class="col-lg-10">
    <span class="input-group-addon">$</span> 
    <input type="text" class="form-control" id="">
  </div>
</div>

Bootstrap 3: Legen Sie benutzerdefinierte Breite mit input-group/input-group-addon und horizontale Beschriftungen

Wie kann ich die Breite des input-Elemente, so dass Sie alle das gleiche?

Ich möchte den linken Rand jedes input-element bündig so:

Bootstrap 3: Legen Sie benutzerdefinierte Breite mit input-group/input-group-addon und horizontale Beschriftungen

Dies ist, wie es jetzt aussieht:

Bootstrap 3: Legen Sie benutzerdefinierte Breite mit input-group/input-group-addon und horizontale Beschriftungen

Dies ist meine aktuelle HTML:

    <div class="col-md-6">
        <div class="content">
            <h2>Income</h2>
        <form class="form-income form-horizontal" role="form">

            <div class="input-group input-group-lg">
            <label for="" class="control-label">Paycheck</label>
                <span class="input-group-addon">$</span> 
                <input type="text" class="form-control" id="">
            </div>

            <div class="input-group input-group-lg">
            <label for="" class="control-label">Investments</label>
                <span class="input-group-addon">$</span>
                <input type="text" class="form-control" id=""> 
            </div>

            <div class="input-group input-group-lg">
            <label for="" class="control-label">Other</label>
                <span class="input-group-addon">$</span> 
                <input type="text" class="form-control" id="">
            </div>

            <button class="btn btn-lg btn-primary btn-block" type="submit">Update</button>
        </form>

        </div>

LIVE-BEISPIEL: http://jsfiddle.net/jfXUr/

  • Nur .form-control und .input-group-addon Elemente sollten rein .input-group Container. Verwenden .form-group Gruppe Ihre Etiketten und .input-group Elemente
  • Wie ist das - jsfiddle.net/jfXUr/1 ?
InformationsquelleAutor Keven | 2013-11-29
Schreibe einen Kommentar