下面是關於這件事情的自舉一個很好的解釋:https://www.w3schools.com/bootstrap/bootstrap_forms_sizing.asp
在這裏,你有3個不同大小:
<form>
<div class="form-group">
<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>
</form>
的DIV類COL-XS-X定義輸入的大小。
您也可以給輸入一個類,並在css中使用的重要重寫引導程序設置:
HTML
<input type="text" name="email" class="smallInput">
CSS
.smallInput {
width: 50px !important;
}
你使用bootstrap,看看這裏http://getbootstrap.com/css/#forms-horizontal爲了看看如何創建一個形式在bootstrap – stanke