首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >引导3表单示例

引导3表单示例
EN

Stack Overflow用户
提问于 2014-02-07 07:45:37
回答 1查看 3.2K关注 0票数 1

我正在学习getbootstrap.com上的基本表单示例

它有以下代码

代码语言:javascript
复制
<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-groupform-group的区别

A2。输入组放置按钮或加载项在输入的任何一边或两边(即左<>右)。另一方面,表格组是自上而下的.(即标签在顶部,文本框在底部)

Q3。是否需要for="exampleInputEmail1" in <label for="exampleInputEmail1">?这在Bootstrap2中似乎并不是必需的。

Q4。input type="email" (和input type="password")是否任意放置?我看到了一些使用input type="text"的代码。是一样的吗?如果我只要求输入是数字,我可以有input type="numbers"吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-02-07 07:57:21

Q1。这是可访问的富互联网应用程序套件ARIA http://www.w3.org/TR/wai-aria/roles WAI,它定义了一种使网络内容和应用程序更便于残疾人访问的方法。

代码语言:javascript
复制
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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/21622051

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档