CSS hover necessarily inline

Discussion in 'CSS' started by Fed, Dec 4, 2006.

  1. #1
    hi guys
    I need to style links with inline styles because I am trying to fix an HTML template for gmail to display it correctly and I need to apply hover styles to links
    I need something similar to this
    <a href="#" style="{background-color: #ffcccc;} :active {color: #FF0000}; :link {color: #FF0000}; :visited {color: #FF0000}; :hover {color: #000000};">linktext here</a>

    this is just an example to let you understand what I mean, I can't get the styles to work and have no idea how pseudo-classes should be declared inline, moreover I hardly found something googling for it, and what I found was totally useless

    any help is really appreciated ;)
     
    Fed, Dec 4, 2006 IP
  2. siu00as

    siu00as Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi,

    Had a quick play around but can't get the any of the hover styles working :mad:

    I noticed you were using curly brackets {}. On my browser using the curly brackets stops the inline styles working. So your best bet is to remove them leaving you code like this:

    <a href="#" style="background-color: #ffcccc;">Link text</a>

    I'll have another try with the hover styles a little bit later!
     
    siu00as, Dec 4, 2006 IP