【发布时间】:2012-06-11 02:20:19
【问题描述】:
我一直想知道 DOCTYPE 之前的 空格 是否重要,但我似乎无法在网络上找到任何确定的信息。人们说不要这样做,但我看不出它可能会产生什么影响,或者即使规范说它必须是那样的。我不知道它是否会触发 IE 中的兼容模式或类似的烦人。
原因是,在我的(蹩脚的 asp.net)代码中,我更喜欢这样写:
<%@ Page language="c#" Codepage="65001" AutoEventWireup="true" %>
<%@ OutputCache Location="None" VaryByParam="none" %>
<!doctype html>
比:
<%@ Page language="c#" Codepage="65001" AutoEventWireup="true" %><%@ OutputCache Location="None" VaryByParam="none" %><!doctype html>
因为第一个更整洁。但最上面的结果是在您呈现的 html 中出现几行空行。
不是一个大问题。我一直想知道这是否重要:)
【问题讨论】:
-
我也有类似情况:
<metal:page define-macro="master"> <tal:doctype tal:replace="structure string:&lt;!DOCTYPE html&gt;" />
标签: asp.net html html5-video doctype