Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/88.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
html标记中是否允许换行?_Html - Fatal编程技术网

html标记中是否允许换行?

html标记中是否允许换行?,html,Html,允许在html标记中使用换行符吗?例如: <h1 id="heading"> Chrome中的第一个测试表明这是可行的,但是规范是否特别允许这样做?所有浏览器(尤其是电子邮件客户端)是否都正确解析了这一点 那么属性呢 <h1 class="one two"> 在这种情况下,它会被解释为一个空格吗 (最后一个案例未在“可能重复的问题”中得到回答)是,可以接受!浏览器将忽略换行符,并将其作为空格进行测试。因此,在第二个示例中,您将有一个h1元素,其中有两个类作为

允许在html标记中使用换行符吗?例如:

<h1
id="heading">

Chrome中的第一个测试表明这是可行的,但是规范是否特别允许这样做?所有浏览器(尤其是电子邮件客户端)是否都正确解析了这一点

那么属性呢

<h1 
class="one
two">

在这种情况下,它会被解释为一个空格吗


(最后一个案例未在“可能重复的问题”中得到回答)

是,可以接受!浏览器将忽略换行符,并将其作为空格进行测试。因此,在第二个示例中,您将有一个
h1
元素,其中有两个类作为属性

所以


< h1 class="one two">

< h1 class="one two">