link to specific location on page

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 3rd, 2006, 17:58
Up'n'Coming Member
Join Date: Mar 2006
Location: UK
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
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?
Reply With Quote

  #2 (permalink)  
Old Dec 3rd, 2006, 20:00
Junior Member
Join Date: Oct 2006
Location: Uxbridge, West London
Age: 26
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #3 (permalink)  
Old Dec 5th, 2006, 12:40
Reputable Member
Join Date: May 2006
Location: Northampton, UK
Posts: 399
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #4 (permalink)  
Old Dec 5th, 2006, 18:46
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: link to specific location on page

The proper way to do it is with id's.

<a href="#top">

<div id="top">
Reply With Quote
  #5 (permalink)  
Old Dec 6th, 2006, 14:23
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: link to specific location on page

Yeah, do Ryan's way it is the correct way to accomplish this.
Reply With Quote
  #6 (permalink)  
Old Dec 7th, 2006, 05:37
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Reply With Quote
  #7 (permalink)  
Old Dec 7th, 2006, 18:32
Up'n'Coming Member
Join Date: Mar 2006
Location: UK
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
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
Reply With Quote
  #8 (permalink)  
Old Dec 7th, 2006, 19:46
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Re: link to specific location on page

That is the correct way snappy.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #9 (permalink)  
Old Dec 8th, 2006, 16:07
Reputable Member
Join Date: Dec 2005
Location: Texas
Age: 19
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to daygon Send a message via MSN to daygon Send a message via Yahoo to daygon
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!!
Reply With Quote
  #10 (permalink)  
Old Dec 8th, 2006, 16:22
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: link to specific location on page

hehehe...lol
Reply With Quote
  #11 (permalink)  
Old Dec 8th, 2006, 21:24
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,761
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: link to specific location on page

OMFGoogle.. Rob's alive? And yes the anchor/div method is muy bueno.
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
  #12 (permalink)  
Old Dec 8th, 2006, 21:38
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: link to specific location on page

hehehe...Rob is alive...lol
Reply With Quote
  #13 (permalink)  
Old Dec 8th, 2006, 23:24
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: link to specific location on page

Reply With Quote
  #14 (permalink)  
Old Dec 8th, 2006, 23:42
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: link to specific location on page

lol
Reply With Quote
  #15 (permalink)  
Old Dec 9th, 2006, 01:02
Reputable Member
Join Date: May 2006
Location: Northampton, UK
Posts: 399
Thanks: 0
Thanked 0 Times in 0 Posts
Re: link to specific location on page

your gonna have to explain this to me guys......... hows ryans method different to mine?
Reply With Quote
  #16 (permalink)  
Old Dec 9th, 2006, 03:09
JacobHaug's Avatar
SuperMember

SuperMember
Join Date: Dec 2005
Location: On Internet
Posts: 4,859
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JacobHaug Send a message via MSN to JacobHaug
Re: link to specific location on page

hehehe...lol
Reply With Quote
  #17 (permalink)  
Old Dec 9th, 2006, 04:33
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: link to specific location on page

They're different, but mine is correct. It's like using target="_blank" in XHTML. It works, but it's not correct.
Reply With Quote
  #18 (permalink)  
Old Dec 9th, 2006, 16:26
Reputable Member
Join Date: Jul 2006
Location: Baldock
Age: 20
Posts: 447
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Aaron1988 Send a message via Yahoo to Aaron1988
Re: link to specific location on page

Ryans way is correct and they best way in my mind but only time i used that was when i was at college and had to do a project with anchor lok for me pages

Thanx
Aarom
Reply With Quote
  #19 (permalink)  
Old Dec 9th, 2006, 23:30
Reputable Member
Join Date: May 2006
Location: Northampton, UK
Posts: 399
Thanks: 0
Thanked 0 Times in 0 Posts
Re: link to specific location on page

sorry i was drunk and i couldnt see the difference lol.... yeah ryans looks more appropriate in the light of sobriety
Reply With Quote
  #20 (permalink)  
Old Dec 10th, 2006, 00:48
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: link to specific location on page

Haha, you must've been really drunk.
Reply With Quote
Reply

Tags
link, specific, location, page

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
internal navigation, Linking from one page to a specific div in another page. Oak Web Page Design 5 Feb 8th, 2008 22:54
Can I set my page to be a specific size on every browser? Inkers Web Page Design 9 Jan 14th, 2007 11:03
link to specific location on page snappy Web Page Design 2 Dec 5th, 2006 18:54
link opens new window problem - still showing location Micky-D JavaScript Forum 6 Oct 27th, 2006 02:45
Open a specific page dependent on what is entered into a criteria box??? IanW Web Page Design 2 Sep 15th, 2006 12:39


All times are GMT. The time now is 08:26.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43