homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

Inserting anchor not working in ff/safari
anchor text doesnt work, firefox safari

 12:07 am on Sep 28, 2010 (gmt 0)

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">&nbsp;</a>
<div class="ProductSubtitle" style="padding:10px; margin-top:10px;">
<h3 id="morecol">{$msg.product.secondary_images}</h3>

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

Thank you!



 3:56 am on Sep 28, 2010 (gmt 0)

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.


 4:56 pm on Sep 28, 2010 (gmt 0)

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]


 5:56 pm on Sep 28, 2010 (gmt 0)

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.


 5:58 pm on Sep 28, 2010 (gmt 0)

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.


 11:47 am on Sep 29, 2010 (gmt 0)

I agree with Michael there is problem with "base href"...try to recheck the whole website code...


 4:04 pm on Sep 29, 2010 (gmt 0)

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 ;(


 5:18 pm on Sep 29, 2010 (gmt 0)

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!


 10:27 pm on Sep 29, 2010 (gmt 0)

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.

<a id="morecol"></a>


 10:30 pm on Sep 29, 2010 (gmt 0)

The original code in the first post does have both, name= and <h3 id="morecol">


 12:19 am on Oct 1, 2010 (gmt 0)

Everyone, I noted the problem long ago: Two conflicting "base href"'s. It's that simple!


 12:23 am on Oct 1, 2010 (gmt 0)

rocknbil, "name" does *not* appear to be deprecated for anchors, according to W3C [w3.org].


 5:07 am on Oct 8, 2010 (gmt 0)

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 :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved