简体   繁体   中英

Anchor-tags not working

The anchor tags on every page of my Wordpress website are not working. I understand how to do them, for example on my contact page, I have

<a href="#end"></a> 

around the mail image. It is linked to before the "thank you" at the end of the page with:

<a id="end"></a>

When the mail image is clicked the link does not execute. If I type in the direct link to the jump, it works. Thanks for any help!

In your page source you have the following:

<a id="end"></a>

It should be:

<a name="end"></a>

It's worth noting though that the name attribute of the <a> tag is deprecated as of HTML5. Therefore to be HTML5 compliant I'd suggest the following:

<h2 id="end">some text at the end</h2>

Note the element can be anything you want. Usually a header tag or similar though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM