September 2008 Archives

Over at Pharyngula, people regularly ask how to format posts in particular ways. Here's a rough guide to the half-dozen most common things people want to do.

In all cases, you use HTML (or HTML-like) tags, which (with a few exceptions) occur in opening/closing pairs with your text in between, like this (for an imaginary tag “foo”): <foo>some text</foo>. You have to be very careful to get the syntax right or you will get unexpected results. Preview is your friend.

Quoting

In order to quote a previous text, use <blockquote>. If you write

“<blockquote>John McCain is a tool.</blockquote>”, it comes out looking like this (indented and possibly with other decoration, such as a bar down the left):

John McCain is a tool.

Italics

You can get italics with <em> or <i>, like this: “John McCain is <em>definitely</em> a tool” produces “John McCain definitely a tool”.

Bold

You can get bold with <strong> or <b>, like this: “John McCain is <strong>definitely</strong> a tool” produces “John McCain definitely a tool”.

Strikethrough

You can strike text with <s>, like this: “John McCain is <s>not</s> a tool” produces “John McCain is not a tool”.

Underline

You can underline text with <u>, like this: “John McCain is <u>such</u> a tool” produces “John McCain is such a tool”.

Links

You can produce links with <a>. The text to be linked appears between the elements, and the URL appears in the href attribute. “<a href="http://www.google.com/">Google</a>” comes out as “Google”. Note that the quotes around the URL and the http:// are not optional. Also, including more than a certain number (2 or 3) links may result in your comment being held for moderation as an anti-spam measure. Preview is your friend.

Physical vs. Logical Markup

Not that it makes much difference in the tag soup that is the blogosphere, but to satisfy the pedants, I should note that the <em> element is preferred for emphasis and <i> for non-emphatic italics. Similarly, <strong> is preferred for strong emphasis and <b> for non-emphatic emboldening.