下面是关于这件事情的自举一个很好的解释: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