Pages

Saturday, January 19, 2013

HTML Comments

w7r.blogspot.com


Who Would Waste Their Time Commenting their HTML???

Turns out, not too many people comment their HTML code, which is a shame because it causes a hellish amount of problems for website and program developers alike. If you have never heard of a 'comment' then no need to worry. A comment is literally a.. COMMENT; however, the comment acts as notes to you and other web developers as to what the code in a specific region does.


An Example of Practical HTML Commenting

Blogger templates provide beautiful website designs that have already been coded for you; however, when a blogger such as myself wants to make changes to the Template code, I have to dig into the source code for my template (which is a MESS). Blogger template codes are usually an eye-sore, so to make my template easier to maintain and tweak I labeled the different segments of my blog code with HTML comments.

For example, I label my additions of code into the template by placing a a line before the content I wrote. None of the comment will be displayed on the blog.


Real HTML Comment Samples

Supreme

Great

Good

Paragraph 1

Paragraph 2

Supreme

Great

Good

Paragraph 1

Paragraph 2



What To Remember!

  1. HTML format for a comment is <!-- this is a comment -->
  2. Comments are a concept that is much larger than HTML is itself. ALL PROGRAMMING LANGUAGES IMPLEMENT WAYS TO COMMENT!!!
  3. Comments are programmers notes
  4. Using comments in HTML saves you hours of time on large projects and website designs
  5. Comments can span multiple lines and contain any characters you desire!
  6. Incorrect Syntax of a comment could reveal your comment to your website visitors


More HTML Posts!

No comments:

Post a Comment