根据标题;是否可以在有效的 HTML 中嵌套注释?看下面的例子…
<p>some text</p>
<!-- comment 1
<p>commented out html</p>
<!-- comment 2
// are nested html comment allowed?
end of comment 2 -->
<p>more commented out html</p>
end of comment 1 -->
<p>some more text</p>
似乎没有,有人知道我如何让嵌套评论起作用吗?
原文由 QAZ 发布,翻译遵循 CC BY-SA 4.0 许可协议
嵌套注释时,将“–”替换为“–”。当你取消嵌套时,相反的过程。禁止的不是
<!--
而是--
。例子: