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

WBOY
發布: 2023-08-31 15:05:06
轉載
1435 人瀏覽過

如何在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
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!