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="http://henrytheadequate.blogspot.com">Henry the Adequate </a>
Looks like this: Henry the Adequate

This: <a href="http://henrytheadequate.blogspot.com"><img src="http://photos1.blogger.com/blogger/3685/171/320/henry-axe.0.jpg"> </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.

Explanation:
  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="http://henrytheadequate.blogspot.com" 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.

5 comments:

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!!!!
I DID IT!!!
Finally!!!
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.