This is a discussion on "link to specific location on page" within the Web Page Design section. This forum, and the thread "link to specific location on page are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
link to specific location on page
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
link to specific location on page
I have been using <a name="#"> to create links from a menu to different specific locations on a page.
I must be doing something wrong as each menu link goes to the same anchor point each time even though I've given them separate and specific names. It works on the first one just fine but then returns to the same point from all of the other links. By the way I would like it to be W3C validated too. Any tips? |
|
#2
|
|||
|
|||
|
Re: link to specific location on page
Can you paste your code on here, i am sure it will help people to give you better assistance
|
|
#3
|
|||
|
|||
|
Re: link to specific location on page
To create links to a link within the page, currently two HTML tags need to be used.
<A HREF="#top">Top</a> <A NAME="top"> The first tag <A HREF="#top">Top</a> is different in that it has a # which represents a name statement. When the user clicks on Top, the computer would then go to the name tag, if found. The second tag <A NAME="top"> is where the first tag will reference when clicked. |
|
#4
|
||||
|
||||
|
Re: link to specific location on page
The proper way to do it is with id's.
<a href="#top"> <div id="top"> |
|
#5
|
|||
|
|||
|
Re: link to specific location on page
Yeah, do Ryan's way it is the correct way to accomplish this.
|
|
#6
|
||||
|
||||
|
Re: link to specific location on page
I've never actually heard of using the name attibute before... You can use targets in HTML, but it's not valid XHTML.
|
|
#7
|
|||
|
|||
|
Re: link to specific location on page
Ryan's way works fine. Thanks!
Just one thing I'm using <div id="top"></div> where I want to point to and then <a href="#top">link</a> to point to it. Is that the correct way or is there a better way? It validates, but just want to be sure. Cheers Snappy |
|
#8
|
||||
|
||||
|
Re: link to specific location on page
That is the correct way snappy.
__________________
Rob - Webforumz Founder I am currently NOT available for SEO consultancy work My Sites: Student Midwife Forum
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#9
|
|||
|
|||
|
Re: link to specific location on page
Yeah i did it on my old company site that i was working on and W3 said it was ok so you shoud be good.
RYAN's THA MAN!! |
|
#10
|
|||
|
|||
|
Re: link to specific location on page
hehehe...lol
|
|
#11
|
|||
|
|||
|
Re: link to specific location on page
OMFGoogle.. Rob's alive? And yes the anchor/div method is muy bueno.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|
|
#12
|
|||
|
|||
|
Re: link to specific location on page
hehehe...Rob is alive...lol
|
|
#13
|
||||
|
||||
|
Re: link to specific location on page
|
|
#14
|
|||
|
|||
|
Re: link to specific location on page
lol
|
|
#15
|
|||
|
|||
|
Re: link to specific location on page
your gonna have to explain this to me guys......... hows ryans method different to mine?
|
|
#16
|
|||
|
|||
|
Re: link to specific location on page
hehehe...lol
|