The HTML Comment Tag: Here's How To Use It In Your Code »

Skip to content HTML / HTML Document Structure Before And After HTML5 – Here’s What Changed / The HTML Comment Tag: Here's How To Use It In Your CodeDisclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn moreElement ofHTML Document Structure Before And After HTML5 – Here’s What ChangedWhat does The HTML Comment Tag: Here's How To Use It In Your Code do?This element is used to add a comment to an HTML document. An HTML comment begins with <!–– and the comment closes with ––>. HTML comments are visible to anyone that views the page source code, but are not rendered when the HTML document is rendered by a browser.Displayinline

Code Example

You will be able to see this text. <!-- You will not be able to see this text. --> You can even comment out things in <!-- the middle of --> a sentence. <!-- Or you can comment out a large number of lines. --> <div class="example-class"> Another thing you can do is put comments after closing tags, to help you find where a particular element ends. <br> (This can be helpful if you have a lot of nested elements.) </div> <!-- /.example-class -->You will be able to see this text. You can even comment out things in a sentence. Another thing you can do is put comments after closing tags, to help you find where a particular element ends. (This can be helpful if you have a lot of nested elements.)Adam WoodAdam is a technical writer who specializes in developer documentation and tutorials.

Browser Support for html comment

iefirefoxchromeedgesafariopera
AllAllAllAllAllAll

Post navigation

The Student’s Guide To Citation Styles: Here’s When (And How) To CiteHTML Img Alt Tags For SEO Best Practice - Search Engines Love Them

Search HTML.com

Search for:

Most Popular

  • <var> HTML Tag315 views
  • 10 Famous Hackers I’d Like to Date (and Why)68 views
  • What Is Doxing? (And Why Is It So Scary?): An Infographic50 views
  • Input Pattern: Use It To Add Basic Data Validation In HTML548 views
  • Using The HTML Tag To Create Inline Frames: Here's How38 views
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok

Từ khóa » Code Bình Luận Html