Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Help with <a> tag


  • Please log in to reply

#1
Alex_McIntosh

Alex_McIntosh

    Member

  • Member
  • PipPipPip
  • 277 posts
I am trying to build a personal Homepage, i want to also have links to the main sites i go onto... When i am creating a orderd list , i do the following code below... But when i save and open the file in firefox it displays instead in teh address bar

file:///C:/Documents%20and%20Settings/Owner/Desktop/www.geekstogo.com


So i don't know how to cancel that out, there is no file called that in that directory, that isn't even where i am saving the files... :S

<ol>
<li><a href="www.geekstogo.com">GeeksToGo</a></li>
</ol>


That is just an example of what i am using.

Is there anyone that can help me?
  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
First, do not put your links in an ordered list. Use an unordered list for multiple links. Second, no link should have file:/// or C:/ as part of the path if it is to be used online. Nor should you have spaces or uppercase letters in folder/file names. Especially if using XHTML 1.0 Strict. You didn't mention the HTML Editor you are using or whether you know how to hand code HTML/CSS.

You seem to be saying about saving a file. Or you linking to a file on your web site or to a file on another web site? There's no problem with using full path links as long as the full path reflects the directory structure of your site and not the directory structure of your site on your hard drive. A suggestion: always mirror the directory structure on your hard drive with the one actually online.

Ron

Edited by Major Payne, 21 April 2008 - 05:00 PM.

  • 0

#3
Alex_McIntosh

Alex_McIntosh

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 277 posts
I'm using notepad, and I know quite extensive HTMl and learning CSS (You know might know it is not hard to learn anyway)

I have never really came across this problem though.

I am using strict or though for what i want transitional might be better, i'll stick to strict for now though...

Would it help if i showed you all the HTML so far?

and i dont know why it has 3 "/" in it, i didnt put them like that... All i want is a anchor tag that will be in a list (Ordered or not) and link to a site so i thought that i have it correct...

Still why is it linking to that path and not the website?

EDIT:Spelling mistakes =]

Edited by Alex_McIntosh, 22 April 2008 - 02:18 AM.

  • 0

#4
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
Try

<a href="http://www.geekstogo...">GeeksToGo</a>

By omitting the protocol it looks for a file called "www.geekstogo.com" on your desktop.
  • 0

#5
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts

Would it help if i showed you all the HTML so far?
Would like to see it if possible.

and i dont know why it has 3 "/" in it, i didnt put them like that... All i want is a anchor tag that will be in a list (Ordered or not) and link to a site so i thought that i have it correct...

file:/// is the proper way with 3 "/"s to get a file link to work LOCALLY" Somehow the full path was elected to be put in and the editor knows how to do it correctly so it will work. It will not work as an online link as there is no "c" drive there. :). You must use http:// for the correct protocol.

Still why is it linking to that path and not the website?

Using

<a href="http://www.geekstogo.com">GeeksToGo</a>
will only cause a browser to display the GTG page. If no browser open, then clicking on the link locally will cause default browser to open to GTG's page. This will work online and will do the same depending on options set in browser for activated links. (Either a new tab or window will be open.). NotePad does not have the sophistication to insert code for an html file. It is a text editor and it is up to the person writing code to put correct tags and other code on the page before saving it with an htm/html extension.

EDIT:Spelling mistakes =]


No way another editor did some code insertions before you started with NotePad? That could only account for an Option being set to use full paths and not relative paths.

Ron

Edited by Major Payne, 22 April 2008 - 04:26 PM.

  • 0

#6
Alex_McIntosh

Alex_McIntosh

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 277 posts
I really didnt understand that at all, could you elaborate please?
  • 0

#7
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Might be better to stick with Metallica's answer then. Without the http:// in your links, the browser is not going to look for anything on the web.

Ron
  • 0

#8
Alex_McIntosh

Alex_McIntosh

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 277 posts
I'll give it a go now

Thanks so far :)
  • 0

#9
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
OK. Just didn't want to get into a lot more explanation without actually seeing your code and the actual page9s) online. :)

Ron
  • 0

#10
Alex_McIntosh

Alex_McIntosh

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 277 posts
It's all working now, thanks people! :)

The problem was that it was searching for the file "www.geekstogo.com" but with the "HTTP://" infront of it it looks on the web.

:)

Thanks again :)
  • 0

#11
Metallica

Metallica

    Spyware Veteran

  • GeekU Moderator
  • 31,674 posts
:)

Glad we could help.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP