是否可以在结束后包含标记</html>;标签?

是否可以在结束后包含标记</html>;标签?,html,asp.net-mvc-3,Html,Asp.net Mvc 3,因为,在结束标记后包含标记可以吗 这方面的一个例子就是。一些示例输出如下所示: <!DOCTYPE html> <html> <head> <title>Index</title> <link href="/Content/Site.css" rel="stylesheet" type="text/css" /> <script src="/Scripts/jquery-1.4.4.min.js

因为,在结束标记后包含标记可以吗

这方面的一个例子就是。一些示例输出如下所示:

<!DOCTYPE html>
<html>
<head>
    <title>Index</title>
    <link href="/Content/Site.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-1.4.4.min.js" type="text/javascript"></script>
</head>

<body>

<h2>Index</h2>

</body>
</html>
<!-- Extra content after closing html tag! -->
<html>
<div id="haackroutedebugger" style="background-color: #fff;">
    <style>
        #haackroutedebugger, #haackroutedebugger td, #haackroutedebugger th {background-color: #fff; font-family: verdana, helvetica, san-serif; font-size: small;}
        #haackroutedebugger tr.header td, #haackroutedebugger tr.header th {background-color: #ffc;}
    </style>
    <hr style="width: 100%; border: solid 1px #000; margin:0; padding:0;" />
    <h1 style="margin: 0; padding: 4px; border-bottom: solid 1px #bbb; padding-left: 10px; font-size: 1.2em; background-color: #ffc;">Route Debugger</h1>
    <div id="main" style="margin-top:0; padding-top:0">
        <p style="font-size: .9em; padding-top:0">
            Type in a url in the address bar to see which defined routes match it. 
            A {*catchall} route is added to the list of routes automatically in 
            case none of your routes match.
        </p>
        <p style="font-size: .9em;">
            To generate URLs using routing, supply route values via the query string. example: <code>http://localhost:14230/?id=123</code>
        </p>
        <p><label style="font-weight: bold; font-size: 1.1em;">Matched Route</label>: {controller}/{action}/{id}</p>

        <div style="float: left;">
            <table border="1" cellpadding="3" cellspacing="0" width="300">
                <caption style="font-weight: bold;">Route Data</caption>
                <tr class="header"><th>Key</th><th>Value</th></tr>
                    <tr><td>controller</td><td>Home&nbsp;</td></tr> <tr><td>action</td><td>Index&nbsp;</td></tr>
            </table>
        </div>
        <div style="float: left; margin-left: 10px;">
            <table border="1" cellpadding="3" cellspacing="0" width="300">
                <caption style="font-weight: bold;">Data Tokens</caption>
                <tr class="header"><th>Key</th><th>Value</th></tr>

            </table>
        </div>
        <hr style="clear: both;" />
        <table border="1" cellpadding="3" cellspacing="0">
            <caption style="font-weight: bold;">All Routes</caption>
            <tr class="header">
                <th>Matches Current Request</th>
                <th>Url</th>
                <th>Defaults</th>
                <th>Constraints</th>
                <th>DataTokens</th>
            </tr>
            <tr><td><span style="color: #c00">False</span></td><td>{resource}.axd/{*pathInfo}</td><td>(null)</td><td>(empty)</td><td>(null)</td></tr><tr><td><span style="color: #0c0">True</span></td><td>{controller}/{action}/{id}</td><td>controller = Home, action = Index, id = UrlParameter.Optional</td><td>(empty)</td><td>(empty)</td></tr><tr><td><span style="color: #0c0">True</span></td><td>{*catchall}</td><td>(null)</td><td>(null)</td><td>(null)</td></tr>
        </table>
        <hr />
        <h3>Current Request Info</h3>
        <p>
            AppRelativeCurrentExecutionFilePath is the portion of the request that Routing acts on.
        </p>
        <p><strong>AppRelativeCurrentExecutionFilePath</strong>: ~/</p>
    </div>
</div>

我注意到他的附加标记以
标记开头。此标记的存在是否以某种方式验证了此内容的位置?

不,这不正常,但浏览器对糟糕的HTML非常宽容


尝试查看文档是否为有效的HTML(它不是)。

格式良好的页面(正确的顺序、标签的打开和关闭)加载速度更快,让最终用户更满意。使用适当的HTML,最好是在可能的情况下使用XHTML,这是很有品味和礼貌的。这样做,你就会赢得朋友并影响他人。

+1另一个(或更好的问题)是菲尔图书馆为什么要这样做。看起来很奇怪。我认为他这么做是因为你不必添加任何boodstrap代码就能让它工作。而且,他的路由调试器是一个诊断工具,而不是生产功能。调试时,有效的标记不太重要。XHTML从未离开孵化器:}格式良好的文档每次都会获胜。不要这样做?浏览器将做出选择。它们可能很糟糕。