Many people will find that when using the nested comments of html, they will find that it cannot achieve the effect we thought. Internet search failed, and suddenly found a way to realize the nested use of comments in html.
If we use nested comments in html↓
<!-- 这是一个注释 <!-- 这是注释中的注释 --> -->
Then the situation after running is like this↓
This obviously did not achieve the purpose we wanted.
Here is the correct way to use it:
<!-- 这是一个注释 <!-- 这是注释中的注释 -> -->
As shown in the figure above, as long as you hit one less "-" in the inner nest, it's fine
Complete code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<h1>HTML如何嵌套使用注释</h1>
<p>嵌套的错误使用方式↓</p>
<!-- 这是一个注释 <!-- 这是注释中的注释 --> -->
<p>嵌套的正确使用方式↓</p>
<!-- 这是一个注释 <!-- 这是注释中的注释 -> -->
<p>嵌套的正确使用方式↓</p>
<!--
这是一个注释
<!-- 这是注释中的注释 ->
-->
<p>这是一段话</p>
</body>
</html>
running result:
You will be smart, thank you for your support!
Come on!
Work together!
Keafmd