|Inserting anchor not working in ff/safari|
anchor text doesnt work, firefox safari
So this is a question I have seen written a thousand times but I cannot find a solution, hoping someone has one :)
I have a shopping cart and i would like to jump from the top to the bottom when more colorways exist for each product. It works in IE and Chrome and does not work in Firefox and Safari, can anyone tell me what I am doing wrong or how to correct it?
<a href="#morecol" class="button" style="color:#FFFFFF;" >More Colors</a>
and it should jump to:
<a name="morecol"> </a>
<div class="ProductSubtitle" style="padding:10px; margin-top:10px;">
The problem is, as the content is dynamic, I cannot add the page in href,I only specify with #. Just need it to find it's anchor down the page. For example (not sure if i can have links in post,I will write like this):
The link should be:
in ff/safari, with the above code, the link goes to
Your code works fine for me in Firefox and Safari. I click the link, and it jumps down to the anchor. (I did add a 2000-pixel high paragraph after the link in order to give it something to jump to.
Thanks for the reply!
Did what you suggested adding the following (was that what you meant?)
<a href="#morecol" class="button" style="color:#FFFFFF;" >More Colors</a> <p style="height:2000px;"></p>
Can you tell me if it works for you on the real site cuz still not working for me :( (since removed the paragraph height)
< link removed at member request >
click on "more colors" grey button and should drop you to the bottom of the page.
link should take you to same page and #morecol but in safari/ff goes to home page and #morecol because I believe of the dynamic content- how to get these browsers to understand it is on the same page?
[edited by: tedster at 5:22 pm (utc) on Sep 29, 2010]
Ah, here's your problem:
|<base href="http://shoppingforachange.org/"/> |
That tells the browser to start all urls with that address.
In fact, your code has two "base href" declarations, one good and one bad. Take out the bad one and you're fine.
Sometimes being able to see the actual page (and the whole code) really helps. However, that's actually not allowed here on WebmasterWorld, so just a heads up that a mod will remove links you post and ask you not to do that any more.
You've got a number of nesting errors in the mark-up, and these might well be causing confusion. Validate before you try to debug, or you may be infinitely frustrated.
I agree with Michael there is problem with "base href"...try to recheck the whole website code...
|Sometimes being able to see the actual page (and the whole code) really helps. However, that's actually not allowed here on WebmasterWorld |
I'm willing to experiment with allowing the links in this case. It seems to be strange enough that visiting the page may be needed to debug. Just a warning - this thread may begin to compete with your own URLs in the rankings ;(
Thanks so much everyone for your replies- helping me out a lot here! Tedster, thank you for allowing me to post the links, now that I am on path to eliminate the issue, can you remove the links? I tried but too much time has past to edit the post now.
The site has only been live for 1 week and since google has only indexed a handful of pages, it doesnt need this one up there with its few pages indexed!
Thanks again everyone!
Name is deprecated for anything but form controls, you could try using an id instead. May not make a difference, but it's the right way, and might even work.
The original code in the first post does have both, name= and <h3 id="morecol">
Everyone, I noted the problem long ago: Two conflicting "base href"'s. It's that simple!
rocknbil, "name" does *not* appear to be deprecated for anchors, according to W3C [w3.org].
My apologies for taking so long to get to this but everything seems more important than the next when a site goes live-
Just wanted to tell MichaelBluejay and Anuseo that you were absolutely correct, removing the base href did the trick! Anchors work like a charm now. Thank you so very much for your input! You really saved me on that one :)