HTML AND CSS BASICS: WHY USE HTML COMMENTS <!– –> ?

Leon “2K” Asare

FIRST WHAT ARE HTML COMMENTS?

HTML <!–comments–> are little sentences or paragraphs that you put into your HTML document.  The comments can be read by (you) the web developer,  but are not meant to be viewed by your website visitors.

THEN WHY USE COMMENTS IF VISITORS CAN’T SEE THEM?

The usefulness of HTML comments come in the fact that they can and should be used as notes for web developers. For example,  let’s assume that you have a large HTML document,  with many links, sections, images and hundreds if not thousands of lines of code. It would be a very good idea to put comments in each section and area that has it’s own unique task. The reason for this is because the next time you revisit your code to upgrade it, you may need to be reminded of the reason each section of your code was invented for, also if you work in a team, your development team will  find it helpful if your comments help guide then through the matrix of your code syntax.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s