是否不再需要用引号将HTML5中的属性值括起来? [英] Is it not anymore necessary to enclose the values of attributes in HTML5 with quotes?

查看:138
本文介绍了是否不再需要用引号将HTML5中的属性值括起来?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试学习HTML5,并且看到了一些类似的教程:

I am trying to learn HTML5 and I saw some tutorials that do something like:

<input type=email>

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

And I noticed that it differs from XHTML where most values (if not all) should be enclosed in quotes.

这会不会有我将来要注意的事情?

Will this have any future things that I have to take caution of?

推荐答案

我将向您介绍该规范:

I'll refer you to the specification: http://www.w3.org/TR/html5/syntax.html#attributes-0

可以用四种不同的方式指定属性:

Attributes can be specified in four different ways:

  • 空属性语法
  • 未加引号的属性值语法
  • 单引号属性值语法
  • 双引号属性值语法

这篇关于是否不再需要用引号将HTML5中的属性值括起来?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆