The Slacker's Guide to HTML


[
advanced search]

Home
HTML
Basics
Text Tags and
Text Positioning
Images
Links
Forms
Tables
Frames
Adding Sound
Meta Tags
Horizontal Rules
Comment Tags
Tips & Tricks
HTML Tips
ASCII Codes
RGB Color Chart
Refreshing Pages
Viewing Source
CSS
Basics
Selectors
Properties
Values
Cursor Effects
Positioning Content
Measurement in CSS
Centering with CSS
Custom Form Buttons
CSS For Links
Javascript
Archive
Dynamic HTML
Archive
XHTML
Basics
Rules
Site Success Center
Site Promotion
Monetize Your Site
Extras
IE Vs. FireFox
Downloads
Myspace Comment




Comment Tags

Are you here looking for a way to place a form on your website so that people can submit comments? If so, then you should be here learning about text input fields and the submit button


By placing comment tags within your HTML document you can not only provide yourself reminders as to your organization or intention when you wrote the code but you can guide someone who might be scanning your source code.

If you don't really care too much about helping your fellow man then you should at least be concerned with keeping your own code in order. Sometimes you write some code and then a year later you are looking at it wondering what the hell you were thinking. You are trying to figure out where one HTML table ends and another begins. You are trying to find a specific piece of HTML in the document but you have to read through about 2,000 lines of wrapping text and it's making your eyes tear and you want to go murder someone. In a fit of aggravated anger you pick up the phone and call your boss and you tell him or her to back off about that late project because you're feeling very dangerous and you don't know what you're capable of doing if provoked and your boss asks you what the hell is going on and you bang the phone against the table over and over again and it's 11 a.m. but you pour yourself a drink and you chase it down with some Vicadin from that time you fractured your toe with the paperweight on your desk and your boss comes in and sees you drinking and sees the Vicadin and looks and sees your stupid HTML on the screen and then your boss asks you why you aren't working on that quarterly report and you mumble something about the damned tables and your boss looks as the Vicadin and looks at the scotch and tells you to pack your shit and get the f*ck out your boss tells you that your office better be empty by lunch break or security will remove you from the property and you sort of burp a little bit and then your boss walks out and you're just sort of sitting there and you're trying to figure out how all that scotch is going to fit into your briefcase and then you realize you just got fired and you have a drinking and prescription medication problem and you start to cry.

Something like that.

And you don't want that to happen. So use the comment tag and use it often. Without further ado...
<!--your comment goes here-->
You can place any plain text you want in that tag. Notice that there is no closing tag and also notice that you can use blank spaces between words if you want.

You can also make a comment tag in another way. This second method is to be used with CSS and it's derived from the C Programming Language.

/* commented text */ The text between the slashes and asterisks will be the comment, and none of it will be visible except in the source code.

It's often a smart idea to throw some comment tags before and after the different sections of your page and before and after large blocks of code which you don't want to alter. A well-placed comment tag will also jog your memory when you are looking at something and trying to figue out what it is, where it starts, and where it ends.