From the course: HTML for Programmers
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Code comments
- [Instructor] Sometimes you may want to include comments in your HTML code to explain a piece of code or comment out a chunk of code for debugging purposes. Comments are created with a less-than sign, exclamation point, than two hyphens. Add your comment, then close the comment with two hyphens and a greater-than sign. Let's say we have the following code. On line 13, we have texts that we want to turn into a comment. We can use the comment format we just discussed. We open the comment with a less-than sign followed by an exclamation mark and two hyphens. Next comes the comment. Then we close the comment with two hyphens and a greater-than sign. Comments are a great way to add additional context to your code. Just be sure you're not overusing them.