Creating anchor links on other pages

  • 1
  • Problem
  • Updated 6 years ago
Okay, so my challenge is this:

I want to create anchor links that click through to another page on my site and automatically scroll down to the ID of that anchor link.

I have already read through this guide and it just covers what I already know.

I want my anchor link to be http://www.ilkestonwebdesign.com/pric..." which will wrap around a the word "Email".. and then on the page it links to, there is an ID called "pricing5" wrapping around the heading "Email".

Whenever I click my anchor links expecting to be taken through to my page and automatically directed to my anchor spot, I am not. The page loads as normal at the top.

Any tips? I have tried the URL with and without the .php extension. I'm really not sure about this and what I might be doing wrong.
Photo of ilkestonwebdesign

ilkestonwebdesign

  • 28 Posts
  • 1 Reply Like

Posted 6 years ago

  • 1
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Hi,

This works on sites I have:

http://www.example.com/app/page#anchor

I referenced this article for my understanding and know that Yola have used the base ref for some aspects of their site. The full code overcomes any shortcomings.
Photo of ilkestonwebdesign

ilkestonwebdesign

  • 28 Posts
  • 1 Reply Like
so are you using the base ref tag for each link?
Photo of ilkestonwebdesign

ilkestonwebdesign

  • 28 Posts
  • 1 Reply Like
Sorry, I'm totally confused - I have already done this, and it does not work. This is my question.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
OK. can you tell me your web-site address and the relevant pages and I'll have a look?
Photo of ilkestonwebdesign

ilkestonwebdesign

  • 28 Posts
  • 1 Reply Like
Page is www.ilkestonwebdesign.com/pricing.php

And the small green links have the #anchors on the end.

These should (theoretically) link through to each of the headings on the /pricing-details.php page with the corresponding anchor IDs
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
What I wrote was wrong so i have deleted it.

I am trying to locate your anchors to see if I can identify anything that would obviously cause a mis-alignment.
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Your anchor names don't seem to match.

The heading .co.uk on your pricing page directs to the anchor pricing-details#pricing1. The .co.uk heading on your pricing-details page is labelled as "prices1". It should be "pricing1"

Similarly Colour logo is directed to the anchor pricing-details#pricing2 but the heading Colour logo is labelled as "prices2", should be "pricing2"

This is similar for Google Maps and Contact Details.
Photo of ilkestonwebdesign

ilkestonwebdesign

  • 28 Posts
  • 1 Reply Like
i think I may have just solved the problem.. in fact, i have most defintely. thanks for all your help - you were right about the anchor and ID misalignment. one character difference!

schoolboy error! i feel like i have wasted your time. thanks all the same, i have learnt quite a bit in the process
Photo of Gop

Gop

  • 7473 Posts
  • 2115 Reply Likes
Glad you worked it out. I had the post opened as I was working on it and posted my comment just before yours but later in time and didn't realise in fact that you had discovered the reason. I saw your answer in an email alert.