开发者

Why are my #links linking to my homepage

开发者 https://www.devze.com 2023-04-02 09:20 出处:网络
I\'m working on a page http://www.example.com/control/policies/ I made a link like this: <a href=\"#\">CLICK ME</a>

I'm working on a page http://www.example.com/control/policies/

I made a link like this: <a href="#">CLICK ME</a>

When I click the link I arrive at http://www.example.com/# rather than http://www.example.com/control/policies/#

This happens for all # links (ie: href="#payments", href="#returns", etc.开发者_StackOverflow社区)

Am I missing something?


You're probably missing the fact that you set a <base href="http://www.example.com/"> somewhere in the <head> of your HTML, which is affecting all relative links, including links to anchors.

0

精彩评论

暂无评论...
验证码 换一张
取 消