why does anchor name add a slash to url?

It is okay that the URL changes to http://mysite.com/contact/#rocket, but you should change the way you are defining your anchor on the target page.

Instead of using this method

<a name="rocket"></a>
<div>
<h3>The Title</h3>
<p>some text</p>
</div>

You should add an ID to the content you want to jump to like this:

<div id="rocket">
<h3>The Title</h3>
<p>some text</p>
</div>

This way your HTML markup is cleaner and there isn’t an extra <a> element for the jump.

Leave a Comment