...

View Full Version : linking to a section of a page through another page?



harbingerOTV
02-09-2005, 04:56 AM
Okay i have these:

<a href="#1">balh blah</a>

and later

<a name="1"></a>

in my page.


How do i link to the <a name="?"></a> through another page?

rmedek
02-09-2005, 05:02 AM
<a href="page.html#1">link</a>

... in page.html:

<a id="1">...</a>

It's best to use id instead of name as name is now deprecated.

harbingerOTV
02-09-2005, 05:28 AM
i can change that no problem.

but, how do i link form page2.html to page1html at the id="1" section in page1.html?

rmedek
02-09-2005, 05:35 AM
look above you again... :)

page1.html:

<a href="page2.html#one">link</a>

page2.html:

<div id="one">
This is the section of the page you want to link to.
</div>

I think I also read somewhere you couldn't use numbers for ids or classes, but I could be very wrong on that... hope this works,

harbingerOTV
02-09-2005, 05:48 AM
I'll try that out but will need some retooling as the section that needs to linked into is in a table and linking to the div will only bring it into the start of the div. But I'll tool around with it and see whati can come up with.

gracias

rmedek
02-09-2005, 05:51 AM
you can change the "div" to whatever you need. In other words, <a href="page.html#whatever"> will link to whatever element has the id "whatever."

harbingerOTV
02-09-2005, 05:58 AM
Good thing your on Richard. Sometimes I just need to have things spelled out for me. It only occured to me after reading that and on the can that i can use use a <div...></div>just to define a position in a page. This will be way too easy to implement if they ask for anything that i feel is way too much work otherwise.

Thanks again.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum