Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Problem when linking to an anchor

    Hi there,

    I've got a strange problem with one of the pages on my website...

    I've got a link to an anchor and when I click the link it cuts straight to the anchor but it messes up the top half of the website, and you can't scroll back up to the top.
    Its hard to explain without showing you the page itself. If you click on the article title you can see what I mean...

    http://www.paid2review.co.uk/moneyarticles.html

    I'm not sure if it must be an error with my CSS? Or something causing the anchored link to behave weird?


    Thanks for any help.
    Matt
    Learn how to earn money whilst online, at http://www.paid2review.co.uk

  • #2
    Regular Coder karinne's Avatar
    Join Date
    May 2006
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What do we click on to get this behavior?
    a web design portfolio - blog - last.fm - del.icio.us - widow's walk

    Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions

  • #3
    New Coder
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Underneath "Articles submitted so far" click on either of the 2 article links...


    Thanks
    Learn how to earn money whilst online, at http://www.paid2review.co.uk

  • #4
    Senior Coder ahallicks's Avatar
    Join Date
    May 2006
    Location
    Lancaster, UK
    Posts
    1,134
    Thanks
    1
    Thanked 57 Times in 55 Posts
    Close the <a name> tag immediately after it! I.E don't put any text in. Never seen this before but it's weird because it also breaks the back button so you can't go back to the original page!
    "write it for FireFox then hack it for IE."
    Quote Originally Posted by Mhtml View Post
    Domains are like women - all the good ones are taken unless you want one from some foreign country.
    Reputation is your friend

    Development & SEO Tools

  • #5
    Regular Coder karinne's Avatar
    Join Date
    May 2006
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow ... that is weird. Try using <a id=""> instead of <a name="">

    also ... why do you have an XHTML 1.1 DOCTYPE when you are serving the site as HTML? stick to XHTML Transitional or HTML Strict. That might solve you're problem also ...

    Not many browsers are ready to display sites as XML so ... it's rather pointless. Since you need the XML prolog too and IE can't handly it at the moment.
    a web design portfolio - blog - last.fm - del.icio.us - widow's walk

    Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions

  • #6
    New Coder
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ahallicks View Post
    Close the <a name> tag immediately after it! I.E don't put any text in. Never seen this before but it's weird because it also breaks the back button so you can't go back to the original page!
    I've tried closing it straight after and it does the same, still acts weirdly.

    Also, not sure if this is related to what karinne said in the last post, but when trying to validate the page I get an error:

    Line 125 column 14: there is no attribute "name".
    <p><b><a name="earn-money-from-betting"></a>Earn from "Matched Betting"</b>&nbsp
    Why would this be?

    Thanks for the help
    Learn how to earn money whilst online, at http://www.paid2review.co.uk

  • #7
    Senior Coder
    Join Date
    Jul 2005
    Location
    UK
    Posts
    1,051
    Thanks
    6
    Thanked 13 Times in 13 Posts
    It is related - the name attribute is not supported by XHTML. You should use id= instead, or not use XHTML as a doctype.

  • #8
    Regular Coder karinne's Avatar
    Join Date
    May 2006
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep ... that's why I said to use the id instead of name
    a web design portfolio - blog - last.fm - del.icio.us - widow's walk

    Getting on the Web Standards band-wagon? Get these books - Designing With Web Standards and Web Standard Solutions

  • #9
    New Coder
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Right, thanks for that.

    I've changed it to id instead of name, there are no errors in the validation but the problem is still there - when I click the link it takes me to the anchor but messes up the rest of the page


    Thanks for any help offered.
    Learn how to earn money whilst online, at http://www.paid2review.co.uk

  • #10
    New Coder
    Join Date
    Mar 2007
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Fixed it now, played around with the CSS file. Thanks for all the help


    Matt
    Learn how to earn money whilst online, at http://www.paid2review.co.uk

  • #11
    Regular Coder
    Join Date
    Feb 2007
    Location
    Canada
    Posts
    924
    Thanks
    10
    Thanked 56 Times in 55 Posts
    and the cure was??? what ??? exactly???


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •