| You are here: | About>Computing & Technology>Web Design / HTML> About.com Web Design A to Z> Web Design Articles A-H> Web Design/HTML Articles C> Comments - HTML Comments - Hidden Code |
![]() | Web Design / HTML |
Web Design PathComments on CommentsWhat are HTML Comments and How are they Used
What is a Comment? Most programming languages have comments, they are used to:
Traditionally, comments in HTML are used for nearly anything, from explanations of complex table structures to sarcastic outtakes of the content of the page. Many developers use comments to hide portions of the page that are going to be used later. They are used to tell other people working on the page information about the page.
How to Write Comments <!-- and -->In CSS, it's a little different, using C code comments rather than HTML: /* commented text */.
Comments are a Dying Art This is because the comments are really hard to see in most visual authoring tools. For example, rather than seeing, at the top of a Web page: <!-- DO NOT EDIT THIS PAGE, IT'S AUTO-GENERATED BY A SCRIPT -->The visual tool shows a tiny icon to indicate that a comment is there. If the designer doesn't physically open the comment, he may never see it. And in the case of the above page, could cause problems if she edits the page and that editing is over-written by the script mentioned in the comment.
What Can Be Done?
Even if you're the only person who edits your Web pages, comments can be useful. If you only edit a complicated page once a year, it's easy to forget how you built the table or put together the CSS. With comments, you don't have to remember, as it's written right there for you. Web Design Path |
Las Vegas on a BudgetFind a BargainHotel DealsCheap EatsFree AttractionsEntertainment for Less |
All Topics | Email Article | Print this Page | | ![]() |
| Advertising Info | News & Events | Work at About | SiteMap | Reprints | Help | Our Story | Be a Guide |
| User Agreement | Ethics Policy | Patent Info. | Privacy Policy | ©2008 About, Inc., A part of The New York Times Company. All rights reserved. |


