原因是在Firefox(包括2、3)中,HTML注释中不能出现--(连续两个减号),否则会导致接下来的内容就会暴露出来。
<!--
--
这段中文会显示
-->
其它浏览器都是正常的,大家以后注意一下。
严格地来说,目前其实也不是Firefox的bug,因为HTML4中已经明确说不能这样写了~~~
但Firefox就是死不承认这是bug -_-! 虽然在HTML5中也认为这样写是错误的
但是HTML5中明确了对于这种错误情况的处理是要忽略的
所以最终还将是Firefox的bug ~~~
3.2.4 Comments
HTML comments have the following syntax:
<!-- this is a comment --> <!-- and so is this one, which occupies more than one line -->
White space is not permitted between the markup declaration open delimiter("<!") and the comment open delimiter ("--"), but is permitted between the comment close delimiter ("--") and the markup declaration close delimiter (">"). A common error is to include a string of hyphens ("---") within a comment. Authors should avoid putting two or more adjacent hyphens inside comments.
Information that appears between comments has no special meaning (e.g., character references are not interpreted as such).
Note that comments are markup.