首頁  >  文章  >  web前端  >  如何在HTML中建立隱藏的評論?

如何在HTML中建立隱藏的評論?

WBOY
WBOY轉載
2023-08-31 15:05:061357瀏覽

如何在HTML中建立隱藏的評論?

Comments are used to hide content.

To create hidden comments in HTML, we add tag and end it with -- >. Whatever comes inside this tag it is hidden. These comments allow us to easily understand the code.

評論可以被視為對自己的註釋,也可以讓其他人理解程式碼,同時隱藏HTML程式碼,使得瀏覽器不會在網頁上顯示它。

文法

以下是在HTML中隱藏註解的語法。

<!—The text to be commented -->

Example

的中文翻譯為:

範例

以下是隱藏HTML中註解的範例程式。

<!DOCTYPE html>
<html>
<body>
   <!-- The text here is a commented and it is hidden on the web page -->
   <p>DLF stands for Delhi Land and Finance</p>
</body>
</html>

Example

的中文翻譯為:

範例

Following is another example program to hide comments in HTML.

<!DOCTYPE html>
<html>
<body>
   <!-- <ul>
      <li> 1 </li>
      <li> 2 </li>
      <li> 3 </li>
   </ul> -->
   <p>Delhi is the capital of India</p>
</body>
</html>

We use inline comment tag inside the

tag. To hide the content of the paragraph.

Example

的中文翻譯為:

範例

以下是一個隱藏HTML中註解的範例程序,使用內嵌註解標籤。

<!DOCTYPE html>
<html>
<body>
   <!-- The text here is a commente and it is hidden on the web page -->
   <p>DLF stands for Delhi Land and Finance<!--FinanceDelhi Land and Finance is one of the largest commercial real estate developer in India.--></p>
</body>
</html>

以上是如何在HTML中建立隱藏的評論?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:tutorialspoint.com。如有侵權,請聯絡admin@php.cn刪除