html - 是否不再需要用引号将 HTML5 中的属性值括起来?

标签 html

我正在尝试学习 HTML5,我看到一些教程是这样的:

<input type=email>

我注意到它与 XHTML 不同,在 XHTML 中,大多数值(如果不是全部)都应该用引号引起来。

以后会不会有什么需要注意的地方?

最佳答案

我会向您推荐规范:http://www.w3.org/TR/html5/syntax.html#attributes-0

Attributes can be specified in four different ways:

  • Empty attribute syntax
  • Unquoted attribute value syntax
  • Single-quoted attribute value syntax
  • Double-quoted attribute value syntax

关于html - 是否不再需要用引号将 HTML5 中的属性值括起来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7816233/

相关文章:

java - 沿渐变计算颜色

html - 圆边 table

jquery - 为大型图形的几个单独部分制作动画的想法

html - 复选框出现 gary 并在 Galaxy Built in 浏览器和 Maxthon 中选中

javascript - onChange 事件---> 仅警报工作?!!其他功能无法使用

javascript - 在 AngularJS 中更改 Canvas 的边框颜色

html - Css nth-child 工作很奇怪

css - 另一个 div 中的 div 框

javascript - 我设置了一个 Javascript 函数以在单击按钮时运行,但代码不执行

javascript - 仅选择特定的点击