WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Clickable header/not working in Firefox (5 posts)

  1. davidt82
    Member
    Posted 7 years ago #

    I have an image as a header, working as a clickable link back to the main page. In IE everything appears to work properly, but in Firefox and Safari, on mouseover the image shows a hand, but when clicked does nothing. The site is http://www.almostachef.com and I am using the following code in the header:

    <div id="header" onclick="location.href='http://www.almostachef.com/;" style="cursor: pointer;">

    I realize this may have been touched upon in the forums before, but I am having issues with the search function.

    Thanks!

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    That is some massively bad code there.

    <a href="http://www.almostachef.com">
    <div id="header" onclick="location.href='http://www.almostachef.com/;" style="cursor: pointer;">
    <a name="top"></a><h1>
    </a>
    </h1>
    <div class="description"></div></div>

    I mean, ick. Get rid of the anchor that's in the wrong place. Try something more like this:

    <div id="header" onclick="location.href='http://www.almostachef.com/;" style="cursor: pointer;">
    <a name="top"></a><h1>
    </h1>
    <div class="description"></div></div>

    That might work, even though it's a darned odd way of doing things.

  3. Root
    Member
    Posted 7 years ago #

    If you are dining at Spago why not get a WP pro in to help out? And all that onClick malarkey is completely redundant. A link is a link.

  4. davidt82
    Member
    Posted 7 years ago #

    ok - I exchanged the code with the suggestion given and it's still not working properly. I apologize for the apparently horrible coding you encountered. How about this, will someone please help me with code, or a LINK to make the header work properly in Safari/Firefox. I got that original bit from here on the forums, so I would appreciate any alternatives. THANKS.

  5. davidt82
    Member
    Posted 7 years ago #

    I think I have resolved this, I changed the fact that the header was a background image in the CSS and instead have just planted it as an img in the header file. I did a normal html link from the image and it seems to work properly in both browsers now. If anyone thinks this might be a bad idea, please let me know. thanks for your time

Topic Closed

This topic has been closed to new replies.

About this Topic