View Full Version : Seemingly simple problem with HTML hyperlinks

05-21-2008, 10:17 PM
I am trying to place an assortment of links on a site, however, the links I am placing are comming out like this:


the bolded portion of the link would be an example of one of the sites I'm placing the hyperlink on. the italicised portion is what I actually want the link to go to, but it adds the bolded portion when it opens in the browser. Heres an example of the code im using:

<ahref="www.evaluation.com/sound/Audiosample.mp3">Audiosample - Example 1</a>

Can anyone see any defect in that piece of code? or is this symptomatic of another part of the code I have to troubleshoot?

05-21-2008, 10:29 PM
<a href="http://www.evaluation.com/sound/Audiosample.mp3">Audiosample - Example 1</a>

If you dont add the "http://" it will treat 'www....' as the name of a directory in your root

05-21-2008, 10:31 PM
not sure if you are in the same site, but try this

<a href="/sound/Audiosample.mp3">Audiosample - Example 1</a>

or if that site is external to urs try this

<a href="http://www.evaluation.com/sound/Audiosample.mp3">Audiosample - Example 1</a>

see if that helps

05-21-2008, 11:08 PM
Also watch out for a base element in your document header. It sets the base URL to use for links so it will make all your relative URLs (dir/file.ext) absolute (http://example.com/dir/file.ext) unless you specify an absolute URL manually.

05-21-2008, 11:44 PM
Wow, every possible angle covered, my gratitude could never be expressed in words!

05-22-2008, 12:08 AM
and for those who are keeping score, it was contestant number 3, Kudos for being to figure out what was wrong with my page without even seeing the code that was screwing things up!