Carlo Grassi
Carlo Grassi

Reputation: 21

link with anchor to element in another page

Back with another big question:

I have to create a network of pages with content linked though them. For link inside the same page i'm using this method:

<div id="anchorname">
The content.
</div>

and:

<a href="#anchorname">Link Text</a>

Now i have to link to the #anchorname from another page but it doesn't work, i tried this:

<a href="/pagename#anchorname">Link Text</a>

Is there something i am doing wrong?

Upvotes: 0

Views: 6853

Answers (1)

Drummad
Drummad

Reputation: 722

This is possible to do. You might try using the full name of the page including the suffix. e.g:

<a href="/pagename.html#anchorname">Link Text</a>

If that doesn't work then I would experiment with using a full path.

EDIT: As you've stated that you're using Wordpress then you should try it like this:

<a href="/pagename/#anchorname">Link Text</a>

Upvotes: 2

Related Questions