Turning a Word or Phrase into a Hyperlink

Suppose you're posting a comment on a blog that supports creating hyperlinks and you'd like to change your plain old text sentence from

My friend wrote about this last year.

to

My friend wrote about this last year.

where the underlined text links to your friend's deathless prose.


If you just want to point to your friend's web site, modify your sentence so that it looks like this:

My friend <a href="http://www.example.com/">wrote about this</a> last year.

If you want to link to a specific file on your friend's web site, make your sentence look like this:

My friend <a href="http://www.example.com/somefile.html">wrote about this</a> last year.

If you're linking to a specific file, make sure there's no slash after the filename. The easiest way to get the web address right is to go to the page in question in another browser window, copy the address from the navigation bar, and paste it into your text where you're typing your comment. Sometimes web addresses have a final slash, sometimes they don't. Just copy exactly what got you to the place you wanted to be.




Examples

Link to a website:
 
What you want:
Why not search for it?
 
What you type:
Why not <a href="http://www.google.com/">search</a> for it?
 
Link to a dictionary citation for an obscure word:
 
What you want:
The benefits escheat to the state.
 
What you type:
The benefits <a href="http://dictionary.reference.com/search?q=escheat">escheat</a> to the state.
 
Link to a page buried deep in a website:
 
What you want:
Thought you might appreciate this defense of your swollen post count!
 
What you type:
Thought you might appreciate <a href="http://bloggingheads.tv/forum/showpost.php?p=213581&postcount=79">this defense</a> of your swollen post count!
 
NB: those URLs are actually all typed on the same line. The limitations of the page width show them broken across lines. When you're creating a link, don't put in any carriage returns yourself -- just let the line breaks happen as they will.



Details

Creating a hyperlink breaks down into four parts:

  1. Flag the start of the link: <a href=
  2. Specify the web address that the link points to. Enclose this address in quotes, and follow it with a closing angle bracket.
  3. Type in the text that you want underlined.
  4. Flag the end of the link: </a>

In most places where you can post comments, there is a "Preview" button. Click that. If you've made a mistake, you might get a semi-helpful error message. Or things might just look bizarre. Not to worry. Go back to the composing window, and check for the goofs that I usually make:

  • Web site address not fully enclosed in quotes
  • Forgot the closing angle bracket after the quoted web address
  • Tried to flag the end of the link with <a> instead of </a>, or forgot to flag it altogether
  • Missing angle bracket. Common typos: comma or M instead of the <, period or question mark instead of the >.
  • Extra angle bracket; e.g., </a>>
  • Spurious left or right angle bracket somewhere else in your text

Once you've gotten things looking right, make sure that the link really points to where you think it does. Let the mouse hover over the link, and look at the status bar at the bottom of your browser. See the web address? Good.

For extra credit, try opening the link. Note: If you're in preview mode, posting a comment on some cool blog, you'll want to open the link in a new window, so that you don't lose your edits in the current window. On a PC or Unix machine, right-click on the link and choose "Open Link in New Window" (or something similar) from the pop-up menu. On a Mac (I think), just hold the mouse button down until the menu appears. Try opening a new window with this link.

Is it all good? Click "Publish" and let the flaming begin!

ShareThis