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 -->
以下是隱藏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>
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.
以下是一個隱藏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中文網其他相關文章!