DigitalBurp!

A web developer's blog

HTML link color problem solved

Posted by Vineet on May 14, 2009

Problem: Some browsers show links in the default color in spite of being styled in CSS. On hover the CSS styling works.

Problem faced in: Google Chrome and IE6. No problem in FF

Solution:It is pretty simple by the way. There are two ways to resolve this ..

  1. Dont use a:link ..

    ie. instead of

    #menu a:link { .. }

    use,

    #menu a {..}

  2. And the other way is declare the colors for all the states of the link

    #menu a:link { …}
    #menu a:visited {..}
    #menu a:hover {.. }
    #menu a:active {…}

    Remember the order. Its very important .. (Mnemonic – LoVe HAte)

Many thanks to: A certain CSS freak at webmasterworld forums

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>