Saturday, February 11, 2006

A Quick Howto

Somebody asked me how to insert a link into, for example, a blogger comment. So here's a couple of useful tags.

This: <a href="">Henry the Adequate </a>
Looks like this: Henry the Adequate

This: <a href=""><img src=""> </a>
Looks like this:

This: Crappiest post <b>EVER</b>!!
Looks like this: Crappiest post EVER!!

This: <i>I suck at html.</i>
Looks like this: I suck at html.

  1. A tag is some stuff between < and >
  2. Generally you need an opening tag (<a >) and a closing tag (</a>)
  3. The <a> tag represents a link to another page. You need to specify the page you want to link to, which is where the href="" bit comes in. Note that this is within the tag itself (ie before the >).
  4. Stuff between the opening and closing tags (see 2. above) will be displayed on the screen. This can be text, as in the first example above, or an image tag (<img src="http://link-to-image">). Unlike most an image tag does not require a closing tag. Image tags are not allowed in blogger comments though.
  5. In the second example above we have an img tag nested within an "a" (hyperlink) tag. This is what makes the image clickable. Note that when nesting tags the tag that is opened last must be closed first. For example, </img></a> is correct for the example above, whereas </a></img> would be incorrect.


SquareGirl said...

swell...i can't wait to link henry...i'm tryin to create my very own sidebar and i think this will help...thanks for this post!

SquareGirl said...

Squaregirl would like to officailly invite you to the viewing of her very own sidebar...not much to the saavy blogger, but squaregirl is quite proud of this accomplishment and wants to officially thank benhenry for providing this helpful info...

Ben said...

Well done, and thanks for the link.

Lorraine said...

mmm, I thought mmm someone else is as dumb as I am then I thought, wait he must mean me!!!!
Check it out on my photo blog :)
and thanks!!!

Ben said...

Actually several people have asked about this kind of thing recently.

And thanks for the link.