In this short tutorial, we are going to show you how to put comments in HTML. This is super important to be able to put small notes in your code. So read on for the correct way to create HTML comments.
Table of Contents
Comments in HTML
HTML comments are perfect for making notes and notes in your code. In this way you can have your code organized, structured and documented. Here is how to make these comments:
<h2>Tutoriales de HTML</h2> <!-- Aquí puedes colocar tus comentarios --> <h2>Ejemplos en HTML</h2> <div></div>
To open the comment we use and to close the comment we use ->
Comment code in HTML
Also remember that you can comment out part of your code so that it does not run. This is ideal when you want disable certain part of the code, but keep it for the future to activate it again.
What you should do is place before and -> after the code block to comment. We show you how part of the commented code would look in HTML:
<h2>Tutoriales de HTML</h2></p> <!-- No mostrar esta sección en la web <h2>Ejemplos en HTML</h2> <div></div> -->
That easy! If you have any questions, leave them in the comments so we can help you.