View Full Version : page anchors


junebug
05-09-2003, 02:02 AM
I can't seem to get my page anchors to work.

I used the examples on Lissa's site. Did everything that was supposed to be done. Any ideas why it's not working?

Lemon Squash
05-09-2003, 02:33 AM
Can you post the code your using?

amicus
05-09-2003, 03:40 AM
use the 'a href' tag to go to the anchor. the '#' means it's on the same page.

<a href="#anchorName">Go To Anchor</a>

<a name="anchorName">

junebug
05-09-2003, 04:29 PM
<a href="http://www.angelfire.com/amiga2/njmobster/littlewillum.html#ch1">1</a>

<a href="http://www.angelfire.com/amiga2/njmobster/littlewillum.html#ch2">2</a>

<a href="http://www.angelfire.com/amiga2/njmobster/littlewillum.html#ch3">3</a>

<a href="http://www.angelfire.com/amiga2/njmobster/littlewillum.html#ch4">4</a>

<a href="http://www.angelfire.com/amiga2/njmobster/littlewillum.html/#challenge">challenge</a>


And if I leave out the URL before the # then it goes to my splash page. Also do I put the <a name="ch1"></a>
before the place I want it to link to, or do I put all of the text, a chapter of a story in this case within the tags?

amicus
05-09-2003, 05:23 PM
i'm not sure why that wouldn't work for you, boy that's not cool :(. the anchor looks ok you don't need to enclose the text inside the tag.
have you tried

<a href="littlewillum.html#ch4">4</a>

maybe someone else will know why 'cos it looks ok to me.

Elentari
05-09-2003, 05:27 PM
I'm not entirely sure what you're doing wrong because your page doesn't currently have any page anchors....so, this is an example of how it would work using bits of your page.

Lets say that at the top right before the story starts you want it to say chapter 1, chapter 2 (and so on) and those to be links to the different chapters..... Well this is what the links would look like.

<a href="#ch1">Chapter One</a><A href="ch2">Chapter Two</a><p>
Spike was stalking through the cemetery on his way to the Magic Box. The Slayer had come by earlier in the evening and told him they had a big nasty to fight, which was the reason for his slightly hurried journey through one of Sunnydale’s many graveyards...........

Ok..that should have the links right at the top of your story above the first paragraph. Now......I'm gonna pick a random place in your story to show you how to set up the actual anchor...this is the anchor for chapter one.


<a name="#ch1"></a>
The next morning found the Slayer, key, and peroxided vamp still asleep on the Summers’ couch, the movie long since over. Buffy was the first to awake and quickly realized something was wrong. It took her sleep-addled brain a few minutes to realize, first that it was morning, and second that the curtain were wide open, allowing the sunlight to stream in through the front window.


That is how a page anchor works.........that is assuming that you want the links of the anchors on the same page as the anchors themselves. If you want them on another page THEN you need to put the whole HTML before the anchor name like you have them in your example.

<a href="http://www.angelfire.com/amiga2/njmobster/littlewillum.html#ch1">CHAPTER ONE</a>

WebMasterCole
05-11-2003, 02:30 AM
I don't get how to make the anchors to work, can someone help me?¿:confused:

Elentari
05-11-2003, 04:06 AM
Read the above tutorial and it should be very simple........if you have a specific problem WebMasterCole, post your code or a link and we'll check it out for you.