Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.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,在这个问题上,我只关心HTML5 这似乎不起作用: <code><<!-- test -->span class="otherCode">Bar</span></code> 您可以在标题和正文部分添加注释 在您的示例中,请尝试以下操作: <code><!-- test -->span class="otherCode">Bar</span></code span class=“othe

在这个问题上,我只关心HTML5

这似乎不起作用:

<code><<!-- test -->span class="otherCode">Bar</span></code>

您可以在标题和正文部分添加注释

在您的示例中,请尝试以下操作:

<code><!-- test -->span class="otherCode">Bar</span></code

span class=“otherCode”>Bar您可以在任何标记之间放置注释,但不能在标记声明内部放置注释

因此,这是正确的:

<code><!-- test --><span class="otherCode">Bar</span></code>
条码
…下面是正确缩进的外观(这就是为什么它有意义):


酒吧

这显然打破了
标签。
<code><!-- test --><span class="otherCode">Bar</span></code>
<code>
    <!-- test -->
    <span class="otherCode">Bar</span>
</code>