Bootstrap- Eingabegröße
Eingabegröße in Formularen
Legen Sie die Höhen von Eingabeelementen mithilfe von Klassen wie .input-lg
und fest .input-sm
.
Legen Sie die Breite von Elementen mithilfe von Rasterspaltenklassen wie .col-lg-*
und fest .col-sm-*
.
Höhendimensionierung
Das folgende Beispiel zeigt Eingabeelemente mit unterschiedlichen Höhen:
Beispiel
<form>
<div class="form-group">
<label for="inputsm">Small
input</label>
<input class="form-control input-sm" id="inputsm" type="text">
</div>
<div class="form-group">
<label for="inputdefault">Default input</label>
<input class="form-control" id="inputdefault" type="text">
</div>
<div class="form-group">
<label for="inputlg">Large
input</label>
<input class="form-control input-lg" id="inputlg" type="text">
</div>
</form>
Sie können Beschriftungen und Formularsteuerelemente innerhalb eines horizontalen Formulars schnell anpassen, indem Sie .form-group-*
dem <div class="form-group">
Element Folgendes hinzufügen:
Beispiel
<div class="form-group form-group-lg">
Sie können auch alle Eingaben und andere Elemente innerhalb einer .input-group
mit den Klassen .input-group-sm
oder schnell anpassen:.input-group-lg
Beispiel
<div class="input-group input-group-lg">
Spaltengröße
Das folgende Beispiel zeigt Eingabeelemente mit unterschiedlichen Breiten unter Verwendung unterschiedlicher
.col-xs-*
Klassen:
Beispiel
<div class="form-group row">
<div class="col-xs-2">
<label for="ex1">col-xs-2</label>
<input class="form-control" id="ex1" type="text">
</div>
<div class="col-xs-3">
<label for="ex2">col-xs-3</label>
<input class="form-control" id="ex2" type="text">
</div>
<div class="col-xs-4">
<label for="ex3">col-xs-4</label>
<input class="form-control" id="ex3" type="text">
</div>
</div>
Hilfstext
Verwenden Sie die .help-block
Klasse, um einen Hilfetext auf Blockebene in Formularen hinzuzufügen:
Beispiel
<div class="form-group">
<label for="pwd">Password:</label>
<input type="password" class="form-control" id="pwd" placeholder="Enter password">
<span class="help-block">This is some help text...</span>
</div>