Old 20-02-2008, 10:00   #1 (permalink)
dougmays
Registered User
 
Join Date: Oct 2006
Location: Ft. Lauderdale, FL.
Posts: 90
Send a message via AIM to dougmays
What happened to <a name=blah>??

its been awhile since i've used anchors linking elements on the same page and i just learned that using <a name> has been deprecated. How do you link to a item in the same page now? with ID?

so like:

<a href="#blah">Link to Blah</a>

<h2 id="blah">Blah</h2>

appreciate the help
  Reply With Quote
Old 20-02-2008, 10:04   #2 (permalink)
woodss
Just another web monkey
 
woodss's Avatar
 
Join Date: Mar 2005
Location: Newcastle, UK
Posts: 216
Send a message via ICQ to woodss Send a message via MSN to woodss Send a message via Yahoo to woodss Send a message via Skype™ to woodss
A quick google turned up:

Quote:
On a (Strict?) Doctyped XHTML page, you can reference any element with an ID by the standard hash URL.

For example, I have an ID called content (...). Adding #content to the URL will take me to that location on the page (foo.php#content). Exactly the same behavior as the old name attribute but far easier
  Reply With Quote
Old 20-02-2008, 10:05   #3 (permalink)
woodss
Just another web monkey
 
woodss's Avatar
 
Join Date: Mar 2005
Location: Newcastle, UK
Posts: 216
Send a message via ICQ to woodss Send a message via MSN to woodss Send a message via Yahoo to woodss Send a message via Skype™ to woodss
I think this is one of those things you could've whipped up in like, a minute, to test yourself tho lol
  Reply With Quote
Old 20-02-2008, 10:09   #4 (permalink)
dougmays
Registered User
 
Join Date: Oct 2006
Location: Ft. Lauderdale, FL.
Posts: 90
Send a message via AIM to dougmays
i just wanted to run it by people and see if they were using this new way or if they were still using a name's. thanks though
  Reply With Quote
Old 20-02-2008, 10:37   #5 (permalink)
pgo
i'm done, son
 
Join Date: Jan 2005
Posts: 12,262
There's no reason to use the anchor method any longer.

The correct method uses less markup (if any) and creates an additional, useful styling hook.

Often, there is no need to add an extra ID. For instance, if you want a "jump to top" link, you can often link it to an ID in your template. Like #content or something. In that case, it requires no extra markup.
  Reply With Quote
Old 20-02-2008, 10:56   #6 (permalink)
dougmays
Registered User
 
Join Date: Oct 2006
Location: Ft. Lauderdale, FL.
Posts: 90
Send a message via AIM to dougmays
thats pretty cool...thanks guys
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8