Mobile Phones - Debt Consolidation - Credit Check - Super Mario Games - Unblock Myspace

PDA

View Full Version : Linking with #


n1ck
Nov 14th 2007, 11:37 pm
Ok this is so noobish, but I can't think of how to use # to link on the same page.
For instance, <a href="#blah">

Now what would i put where that blah section is on the page?

I haven't done anything like this in quite a while and I can't remember what its called to look it up. Thanks.

soulscratch
Nov 14th 2007, 11:44 pm
I think back in the old days, developers linked it to elements with a name attribute that had a value equal to the href.


<a href="#foo">foo</a>


Would link to


<a name="foo">foo</a>


But nowadays (and especially if you're using XHTML where name is deprecated on all but some form elements) you should link it to an element that has an ID with a value equal to your href.


<a href="#foo">foo</a>
<h3 id="foo">foo</h3>

n1ck
Nov 15th 2007, 12:05 am
Ah thank you very much exactly what I needed. :)