tags:

views:

218

answers:

2

I add my page top link button like this:

<a name="top"></a> . . .

<a href="#top" title="Top"><img src="images/top.png" alt="Top" id="toplink"/></a>

This is work in firefox well, but doesn't work in google chrome. Why?

+2  A: 

Historically <a name="top"></a> did not work in some browsers because there was nothing between the tags. Maybe this is the problem?

Try wrapping the tags around the first thing to display on the page (e.g. your site logo, if you have it in the top left).

Dave Hinton
A: 

You can use an ID instead for anchor links - this is the preferred method nowadays because it saves adding in <a> tags when unnecessary. For a "back to top" link, add an ID to the <body> tag:

<body id="top">
...
<a href="#top">back to top</a>
</body>
DisgruntledGoat