Dave, I’ve just started a weblog of my own and am finding that I need to learn a few HTML tags to make my entries as attractive as possible. I’d also like to learn how to link to other sites and other Weblogs, but really haven’t much of a clue other than that HTML has < and > around different letters. Can you give me a quick primer?
While most Weblog systems I’ve seen let you just type in your entries with blank lines and let it do the magic of transforming it into clean and valid HTML, you’re right that to get the most out of your weblog writing, you’ll need to learn a few basic HTML tags. Fortunately, it’s easy.
The most important tag is the pair <p> and </p> which surround each paragraph of your input (I’m assuming that you don’t want to use “convert line breaks” but want to have control over all facets of your entry formatting. If not, you can safely skip this particular tag). Rather than using blank lines, just use the common sequence of </p><p> between each paragraph, making sure to start with a <p> and end with a </p>, of course.
001 A few text formatting tags: to italicize something, use <i> and </i> around the words that you want italicized, as in this is in italics. To make something bold (or should I say bold?) use <b> and </b>. You can underline text, though you probably shouldn’t so you don’t confuse readers into thinking it’s a hypertext link, with <u> and </u>.
The only other important HTML tag is a link, and that’s a bit more complex because there are two pieces of data needed for a tag, the text that’s shown on the page as clickable, and the address of the Web page where clicking will take you. So if I have a link like this: go to Yahoo! then I have two pieces of data, the words “go to Yahoo!” and the actual URL of the Yahoo Web page.
To take this nice and slow, let’s start by looking at the general use of the “a” tag. To transform a word or words into a hypertext reference, surround it with <a> and </a>. Like this: <a>go to Yahoo!</a>. That’s half of what we need, though, because while it indicates what words to highlight, it doesn’t include the address of the page to which we’d like to point.
Not to worry though! To add the destination URL, you need to add what’s called an attribute to the “a” tag, which is done by using a name=value pair. In this case, the name is href and the value, always surrounded by quotes, is the URL. Like this:
<a href="http://www.yahoo.com/">go to Yahoo!</a>
Now we’ve got a full hypertext reference that points to Yahoo. You can easily change the URL to anything else you want (you can even open up a new Web browser, surf to a page you’d like to reference, click in the address bar of the browser, then Select All and Copy. Flip back into the window within which you’re writing your latest Weblog epistle and now Paste the URL of the desired page into your text, neatly tucked into the href section)
That covers about 95% of all the HTML I use in my Weblog entries here at Ask Dave Taylor. To learn more advanced HTML, including how to include images, how to work with CSS styles to fine-tune indentation, font-size, etc, and generally to learn the tremendous power of the HTML markup language, may I suggest my popular book Creating Cool Web Sites with HTML, XHTML and CSS?
If you have questions about other formatting effects for within a Weblog, please don’t hesitate to respond to this with a comment and I’ll answer as best I can.