Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Greenhoe

macrumors regular
Original poster
Dec 17, 2008
199
0
Hi,
I wanted to know if it is possible to link to a specific #ID that is on another page.

Such as...
Link from page 1, to an ID on page 2.

If this is possible how do I make the link? Thanks

Thanks
 
I think you have to give it an anchor, not an id.

How exactly do I do that? I'm not familiar with anchors at all. Is it similar to an ID? As I have a ID in a DIV on another page which I'm trying to link to.
 
Use <a name="div1"></a> right before the div you want to link to.

Then for the link use: <a href="page.htm#div1">Link</a>

Replace div1 with whatever name you want.
 
The id attribute will generally work as well. There might be some old browsers that don't understand it, but can't remember specifics.

page.html:
HTML:
<a href="somepage.html#idName">Link to id on some other page</a>
somepage.html:
HTML:
<div id="idName">
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.