Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Named anchors broken in Firefox 1

Status
Not open for further replies.

HeistMonkey

Technical User
Dec 14, 2005
5
US
Hi There -
Here's a weird thing that just happened to me.

I have a page with links that go to an anchor on the same page.

When I click a link in firefox that goes to an anchor in the middle of my page, I can't scroll back to the top.

My 'back to top' link also does not work. The only thing I
can do to see the top of my page again is delete the '#anchorname' from the end of the url.

Works fine Safari on the Mac and IE on Windows.
*Doesn't work in Firefox in either Mac or WIN.

here is the page:



Here is what is really weird:
I built a little test case and the anchor links work just fine.

see the test case here:

The DIFFERENCE would be that in the broken page, the content is styled and is sitting in different divs.

Is there some conflict going on with the divs and positioning perhaps? Has anyone else run into this?
I feel a little like I'm in the Twilight Zone as I've never had this problem before! :D

I validated my page and my css with the W3C tools and both validate...

Thanks for your help! Any ideas would be much appreciated!!
-Daria
 
The two 'Back to top' links on the page work fine for me using Firefox 1.5.0.6. Both make the top of the page appear.

Mike Krausnick
Dublin, California
 
And both fail for me using IE 6.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
in order for "back to top" links to work, you need an anchor (or possibly other tag in more-intelligent browsers) with a name and ID, you then need to link to that anchor.

i.e.:

Code:
<a name="theTop" id="theTop"></a>

Code:
<a href="#theTop">Click To Go To Top</a>



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
It's because of your use of OVERFLOW: hidden; in your stylesheet.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
To split hairs with Cory, you do not actually need an anchor named 'top'. A link that is not found will default to the top of the page. (It is still bad practice, though.)


Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thanks everyone -
cLFlaVA - I read more about the anchors on the w3c site - made sure my anchors had names AND ids associated with them - and my 'back to top' link seems to be working now.


Also: traingamer: I used the * html hack to tell the container to have its overflow be visible in IE - but I am not *totally* sure why this is helping. I'm pretty new to the CSS layouts thing and am busting my hump trying to learn! :D

I'm on FF 1.5.0.7 on both Mac and Win.

Thanks again everyone for taking time out to lend me a hand- much appreciated!
-Daria
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top