« Comments: I | Main | Patience is a Virtue »

March 10, 2005

HTML for Commenters

If you want your comments to look spiffy, and the site that you're visiting accepts HTML in comments - not all do - there are a few HTML tags that can make all the difference. They are: <p>,<i>,<b> and <a>.

But before I tell you how to use them, let me say a word about HyperText Markup Language - HTML. The word is "markup." HTML may look like a code, but in computer terms that's exactly what it's not. HTML is not an application - what laymen used to call "a program." It is simply a body of conventions that your browser, which is an application, utilizes in arranging the display of text. Traditional markup language is directed at (human) printers - make this a paragraph, italicize that word, and so on - and that's pretty much the role that your browser plays. To learn more about HTML, search Google "about HTML," or click here.

Let's see the foregoing as your browser sees it.

<p>But before I tell you how to use them, let me say a word about
<i>HyperText Markup Language</i> - HTML. The word is: markup. HTML looks like a
code, but in computer terms that's exactly what it's not. HTML is not an
application - what laymen used to call &quot;a program.&quot; It is simply a body of
conventions that your browser - which very much <i>is </i>an application -
utilizes in arranging the display of text. Traditional markup language is
directed at (human) printers - make this a paragraph, italicize this word, and
so on - and that's pretty much the role that your browser plays. To learn more
about HTML, search Google &quot;about HTML,&quot; or  click<b>
<a href="http://www.w3.org/TR/html4/intro/intro.html#h-2.2" style="text-decoration: none">
here</a></b>.</p>

Being a cunning fellow, I have contrived to use all four of the useful tags in this paragraph. The first tag, "<p>," marks a paragraph. You will observe the tag "</p>" at the end. If the tag without a slash means "begin," "start," or "on," the slashed tag means "end," "stop," or "off." The slashed tags are not always necessary, but because you cannot neglect them altogether it is best to get into the habit of making sure that they're there. The contents of the paragraph are thus bracketed by <p> and </p>.

Simple, no? You won't need a degree in brain surgery to figure out that "<i>" marks italics or that "<b>" marks boldface. As with <p>, the word(s) that you want to appear in italics or boldface must be bracketed by tags: <i></i>, <b></b>. That leaves "<a>."

<a> is the hyperlink tag. It is arguably the most important tag in HTML, the essence of the Web's magic. Like all other tags, it simply directs your browser to display something in a certain way. But where <i>, say, calls for italicizing a word, <a> calls for your browser to find another page (or another part of the same page) and to display that. Unlike the other three tags, <a> has a host of attributes, or variables, and you need to know at least one of these: "href." This stands for "hyperlink reference" (I think), and it's the attribute that specifies the address of the page to which you want to present a link. You will see, in the paragraph above, that there is also a "style" variable; its function here is to prevent your browser from underlining the link, which it is programmed to do automatically. (Years of wishing that typewriters could print italics have made me detest underlining in almost all cases.) You don't need to worry about style, though, so ignore it.

Notice that the address of the site - it's URL - is placed within quotation marks. Notice, also, that attributes, unlike tags, don't require bracketing: there is no "/href." Notice the use of the "=" sign; this is not negotiable. Using a hyphen or a dash will get you nowhere. The pound sign ("#") in the address signifies a bookmark or anchor - a specific position on the page. All such marks must have their own names, and in this case the name is "h-2.2". If you further questions about the contents of the <a> tag, ask me, by posting a comment to this entry. As a matter of course, if you wish to insert a hyperlink into a comment - and I encourage you to do so wherever a link might enrich your comment - you will simply copy the contents of your browser's Address box - the URL of the page to which you wish to present a link - and paste it directly onto your comment. You don't really need to know what the address means. You do need to be careful about the order of nested tags, as, for example, the nesting of <b> and <a> above. Typing "</b></a>.</p>" at the end would goof things up.

Let me emphasize that HTML is simple but unforgiving. Typos or omissions are fatal. That's why there's a "Preview" button. Previewing un-marked-up comments can be misleading; you don't necessarily see what your comment will look like when you actually post it. Marked-up comments, in contrast, are WYSIWYG.

Many bloggers (and Web site owners as well) use text-editing software to handle tagging. Text-editing software marks up normal text automatically, saving the marked-up version in a file with the extension "htm" or "html." When I publish an entry, I copy the markup and paste it into a window on my copy of Movable Type. I do the same when I write comments. If you plan to do a lot of commenting, it might be worth your while to look into a text-editing package. But whatever you do, don't compose your comments in the Comment box! Use Notepad - standard on all PCs; I don't know the name of the Mac counterpart - and write out your comment there. Then copy and paste it into the Comment box. Comment box contents are unbelievably ethereal, and may vanish if you toggle to another window. So don't do it.

If you are that rarest of creatures, the whizbang genius who doesn't know any HTML yet, you may have wondered how I made the marked-up paragraph appear as a block quotation, indented from both margins. As a dash of whipped cream on this delicious sundae of information, I will tell you: the paragraph is bracketed by <blockquote> tags. Paragraphs (<p> tags) are nested within block quotations (<blockquote> tags).

Now, take two aspirin with a glass of cool water and have a nice lie-down. Your head ought to be spinning. Print this entry and keep it handy. Ask questions. But don't operate heavy machinery anytime soon.

Posted by pourover at March 10, 2005 11:41 AM

Comments

this is EXCITING stuff, i remember early days in Montana when the kids at the nearby Crow Indian village would send signals by puffs of smoke to tell me it was swimming time. these are the same kids who thot that stewed prarie dog was better then roasted buffalo. makes you wonder if TedTurner will discover that a puppy dog tibula properly marinated and toasted beats hell out of those chicken wing thingys

Posted by: chuck at March 14, 2005 09:12 AM

lollol

Posted by: s1 at January 2, 2006 05:48 PM

Post a comment

Thanks for signing in, . Now you can comment. (sign out)

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)


Remember me?