Some tips on using my comment system.
Tips on using my comment system
A lot of blog junkies like to use all kinds of fancy styling in their comments. So, now you can. I hate all of the UBBCode and Textile bastardizations of HTML out there, which aren't really easier than regular HTML anyway, so I'm not implementing any of those. I allow the most useful XHTML tags (<a>, <p>, <b>, <i>, <strong>, <em>, <q>, <blockquote>, <cite>, <code>, <pre>, <abbr>, <acronym>, <br>), so feel free to use them when adding a comment or posting to the guestbook. But try to keep the markup clean.
Perhaps you don't know, but I'm somewhat of a web standards and accessibility evangelist. Basically, I see no reason these days not to embrace web standards and make accessible and semantically meaningful markup. To me, it's easier than the old hacks. But that's all beyond this discussion.
When you enter a comment in my system—or others like it—you need to know a few things about how XHTML works. This list is by no means exhaustive; it's simply the things the average user should know before posting markup to my comment system. If you'd like to see more information on this sort of thing, I refer you to the W3C. They have a simple HTML tutorial, an explanation of how XHTML is different from HTML and a handy FAQ on XHTML.
- For (almost) every piece of text, there is a tag. For example:
<p>for paragraphs,<em>for emphasized text,<strong>for strong text,<q>for an inline quote,<blockquote>for block quotes and so on. - Regular text should only be inside those tags which allow it. The most common problem here is that people use the
<blockquote>tag without anything else. That's bad, and it can cause problems. If you choose to use a block quote, be sure to use<p>tags (or anything else in which text is allowed) inside of the<blockquote>, being sure to keep the order of tags in place. - All tags and attribute names should be in lower case. Simple enough, no?
- For every opening tag, there is a closing tag. So if you start a paragraph with
<p>, make sure you end it with</p>. There are some exceptions to this rule, known as empty tags—tags like<img>and<link>—but there's only one empty tag I allow:<br />(that is the form of an empty tag, by the way). But I recommend against using a line break tag, as it holds no semantic meaning. You're much better off using paragraphs to style text. - Attributes can be useful (or mandatory), so use them correctly. This means that you should always use the form
attribute="value"(remember the double quotes!) for all attributes used, even if some browsers allow them to be omitted. Some instances of attributes you'll use are thehrefwith<a>tags which allows for a hyperlink, thetitlefor<abbr>and<acronym>tags which allows the browser to display the full term for the abbreviation or acronym andciteon<blockquote>which holds the reference for the quote (typically a URL).
So basically, use the tags as they are meant to be used. I recommend that you don't use the <b>, <i> and <br /> tags. There are plenty of semantically meaningful tags that get the job done, and if you use them properly, I think you'll find the old presentation-only tags aren't needed at all. But, since I know someone (*cough*Shaun*cough*) will complain if I don't allow them to be used, I've included them. And if all of this confuses you, just enter your plain text. It will still be readable.
There are other tags I could probably indlude here, but I tried to keep the list to those that would be most frequently used. I won't be including things like images or tables, but if there is a tag you'd like to see included, just let me know.
