Anchor links in Google Chrome

User 629541 Photo


Registered User
7 posts

Hello! :)

I am having issues with anchor links in Google Chrome.

I have a page with several anchor links. They all work fine in IE and Firefox, but in Chrome they either do nothing or jump to the wrong location.

I am guessing Chrome has started handling these differently to other browsers so any tips on how to make it work would be appreciated.

Upon editing the HTML I noticed the anchor objects are all grouped together, for example:

<div class="Object4031"><a name="Mind2"></a></div>

And then these objects are positioned as follows:

div.Object4031 { position:absolute; top:1228px; left:238px; width:15px; z-index:63; }

If I cut and paste the objects manually into the right area in the HTML the anchor links then work in Chrome but obviously as soon as I then edit the file again in VSD it moves them all back to where they should be. :)

Perhaps Chrome isn't handling things as it is expected to.

Any tips appreciated.

Thanks
User 122279 Photo


Senior Advisor
14,453 posts

Post a link, will you? We need to see the problem, in its context.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 187934 Photo


Senior Advisor
20,190 posts

This should help.:)
http://progrower.coffeecup.com/links.html
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 629541 Photo


Registered User
7 posts

Hi Guys,

Thanks for your replies.

Here's a link to the page in question:

http://www.heavenister.com/Dev/EKHDev/EKHTHERAPY.html

Curently for me, the anchor links (accessible from the bullet points at the bottom) only work in Firefox / Internet Explorer. They do not work in Chrome and I am also told the same is true for Safari.

Eric, thanks for the link; I have implemented one of the longer anchor links with the target="_self" etc. yet the link still does not work in Chrome.

I should add the same is true when linking across pages (the bullet points at the bottom appear on each page of the site).

Any tips appreciated.

Thanks
User 187934 Photo


Senior Advisor
20,190 posts

They all work for me in Safari and Chrome.:)
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 629541 Photo


Registered User
7 posts

Strange!

On mine, some do nothing, others take me to the wrong location on the page.

Only for Chrome though. Fine in Firefox / IE.

:/
User 2147626 Photo


Ambassador
2,958 posts

Does not work in Chrome for me! Try this ...

Now this is not on-page navigation, this is page-to-age navigation but with the new page loading scrolled down to the element in question so that it's at the top of the browser window.

Firefox does what I expect perfectly (load the new page with the element named in the hash aligned with the top of the browser), IE does it perfectly, Opera does it perfectly.. but Chrome does not... it seems to try to scroll the page down but doesn't quite get there, and gives an impression that it just stops randomly, somewhere between the top of the page and the element.


i had the same problème, i saw the wiki source, and i just add a tag <p> or tag <div> and put in my <a> with my hash name, and it work fine.

Its look like Chrome does recognize your anchor without tag outside.


Let us know if you figure this out. :cool:
Graphics for the web, email, blogs and more!
-------------------------------------
https://sadduck.com
User 629541 Photo


Registered User
7 posts

Hey Gunsmoke,

I tried it like this:

<p><a name="Weight2"></a></p>

and this:

<div><a name="Weight2"></a></div>

They both worked in Firefox but still not in Chrome! :P
User 1948478 Photo


Senior Advisor
1,850 posts

JonnyB wrote:
Strange!

On mine, some do nothing, others take me to the wrong location on the page.

Only for Chrome though. Fine in Firefox / IE.

:/

I see the same Chrome problem as you do, Jonny. Works fine in Firefox but the landing locations in Chrome are all a bit off, typically ending up one paragraph too low.

The only glitch I see in the coding is a missing closing </font> tag for each of the anchor links, but I doubt that it would cause the problem we're seeing:

<div class="Object2364"><font size="3">
<font face="Calibri">

<a href="EKHTHERAPY.html#Smoking2">Smoking Cessation</a>
</font></div>

I vaguely remembered having seen a very similar case of different behavior in VSD between Chrome and other browsers quite some time ago. I searched the forums and found this:
http://www.coffeecup.com/forums/designe … m-to-work/

Unfortunately it doesn't really seem to provide a solution but if you read through it, maybe you'll get some ideas... :)
User 271657 Photo


Ambassador
3,816 posts

Have you tried these without the page name:
<a href=#smoking2>Smoking Cessation</a> (goes to <a name="smoking2"></a>)*
rather than including the page name:
<a href="EKHTHERAPY.html#Smoking2">Smoking Cessation</a>

*(no need to capitalize your link names)


I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.