pee2pee
pee2pee

Reputation: 3792

Link to Anchor Tag on Another Page Doesn't Work

I have a wordpress site (not available to the public). I have a menu and within that menu, I have a link e.g. http://example.org/schedule/#x-content-band-1

Now, when I click that, nothing happens. The status bar at the bottom of my browser shows that URL (which is correct) but clicking on it does nothing. However if I right hand click and open up a new tab/window, then it opens up the page just fine

LINK

<a href="http://example.org/schedule/#x-content-band-1"><span>Speakers</span></a>

ANCHOR

<div id="x-content-band-1">...</div>

Upvotes: 2

Views: 2724

Answers (1)

isherwood
isherwood

Reputation: 61063

Hyphens can be troublesome in cases where you have multiple similar IDs. Browsers tend to treat hyphenated URL components as separate words, so you may have several that appear identical.

Try underscores or camelCase, or make sure the substring before the first hyphen is unique.

Upvotes: 5

Related Questions