我正在学习getbootstrap.com上的基本表单示例
它有以下代码
<form role="form">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
</form>Q1。为什么role="form"在<form role="form">中有要求?
Q2。input-group与form-group的区别
A2。输入组放置按钮或加载项在输入的任何一边或两边(即左<>右)。另一方面,表格组是自上而下的.(即标签在顶部,文本框在底部)
Q3。是否需要for="exampleInputEmail1" in <label for="exampleInputEmail1">?这在Bootstrap2中似乎并不是必需的。
Q4。input type="email" (和input type="password")是否任意放置?我看到了一些使用input type="text"的代码。是一样的吗?如果我只要求输入是数字,我可以有input type="numbers"吗?
发布于 2014-02-07 07:57:21
Q1。这是可访问的富互联网应用程序套件ARIA http://www.w3.org/TR/wai-aria/roles WAI,它定义了一种使网络内容和应用程序更便于残疾人访问的方法。
role="form" A region of the document that represents a collection of form-associated elements, some of which can represent editable values that can be submitted to a server for processing.Q3。这对于将标签和输入连接起来是必要的。
Q4。不同类型之间的差异将定义输入将如何呈现。types.asp
https://stackoverflow.com/questions/21622051
复制相似问题