Saturday, September 29, 2007

about links and linking

Saturday, September 29, 2007

... i thought this cold, nerdy and un-sexy post needed a hot, sexy picture for balance...
expand the post to see codes for the various ways you can link stuff.

essentially we create a link when we use the anchor ("a") tag with its href attribute. other useful attributes you can specify include:
1. title ~ some text that will appear when users 'mouseover' the link, and
2. target ~ which specifies to the browser to open the link in a new window (the default is '_self') when assigned a value of '_blank'

to link text (to another website)
<a href="http://theurlhere.com/">put your text here</a>


to link an image (to a website)
<a href="http://theurlhere.com/"><img src="http://yourimage.url" /></a>


to link to an email address
<a href="mailto:theredmantissa.blogspot.com">an email link</a>


to link to another part of your document (i.e. like if you have a wildly long blog post and you want to provide navigation links at the beginning of your post or something)

you have to identify the sections of the document using the "a" tag like this:

<a name="intro">Intro</a>



then you can refer to that section like this:
<li><a href="#intro">Intro</a></li>

0 comments: