​ Bootstrap系列 -- 14. 表单控件输入框input ​

2015-06-24 20:56  ​​贺臣​​ 阅读(1154)  评论(0)  ​


编辑 收藏



 

  

  每一个表单都是由表单控件组成。离开了控件,表单就失去了意义。接下来的我们简单的来了解Bootstrap框架中表单控件的相关知识。

  单行输入框,常见的文本输入框,也就是inputtype属性值为text。在Bootstrap中使用input时也必须添加type类型,如果没有指定type类型,将无法得到正确的样式,因为Bootstrap框架都是通过input[type=“?”](其中?号代表type类型,比如说text类型,对应的是input[type=“text”])的形式来定义样式的。



<form role="form">
<div class="form-group">
<input type="email" class="form-control" placeholder="Enter email">

</div>

<div class="form-group">
<input type="text" class="form-control" placeholder="请输入用户名">

</div>
</form>