Hyperlinks Will Not Respond To CSS

Discussion in 'HTML & Website Design' started by Ajak, Nov 25, 2008.

  1. #1
    I can't get the Hyperlinks on this web page to respond to the CSS, what am I doing wrong?

    http://www.dynamata.com/flam/player.html

    Stylesheet code:

    td.right2
    {
    padding: 0.2cm
    border: thin solid Silver;
    background-color: #000080;
    a:link {color: #FF0000}
    a:visited {color: #00FF00}
    a:hover {color: #FF00FF}
    a:active {color: #0000FF}
    }

    Web-page column:

    <td class="right2" width="25%" align="center" valign="top">

    <font font size="1" color="white" face="verdana"><i><b>All songs Copyright © 2008</b></i></font>
    <hr size="4"/>
    <font font size="2" color="white" face="verdana"><b>LYRICS</b></font>
    <hr size="4"/>
    </p>
    <a href="http://www.dynamata.com/songs/Graffiti_Highway_c.txt" >Graffiti Highway</a>
    <a href="http://www.dynamata.com/songs/Graffiti_Highway_c.txt" >Graffiti Highway</a>
    <a href="http://www.dynamata.com/songs/Graffiti_Highway_c.txt" >Graffiti Highway</a>

    </td>
     
    Ajak, Nov 25, 2008 IP
  2. SearchBliss

    SearchBliss Well-Known Member

    Messages:
    1,899
    Likes Received:
    70
    Best Answers:
    2
    Trophy Points:
    195
    Digital Goods:
    1
    #2
    Change your CSS to:
    td.right2
    {
    padding: 0.2cm
    border: thin solid Silver;
    background-color: #000080
    }
    a:link {color: #FF0000}
    a:visited {color: #00FF00}
    a:hover {color: #FF00FF}
    a:active {color: #0000FF}
     
    SearchBliss, Nov 25, 2008 IP
  3. Ajak

    Ajak Peon

    Messages:
    20
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks! that works, I don't know why. I spent hours trying variations but I didn't think you could place the CSS outside the brackets without affecting other elements.
     
    Ajak, Nov 25, 2008 IP
  4. myst729

    myst729 Peon

    Messages:
    289
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #4
    write CSS like this
    #td.right2 a:link {color: #FF0000}
    #td.right2 a:visited {color: #00FF00}
    #td.right2 a:hover {color: #FF00FF}
    #td.right2 a:active {color: #0000FF}
    Code (markup):
    and use ID to invoke the style
     
    myst729, Nov 25, 2008 IP
  5. mds

    mds Active Member

    Messages:
    256
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #5
    Have you tested that in all browsers?
     
    mds, Nov 26, 2008 IP
  6. Ajak

    Ajak Peon

    Messages:
    20
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Works in Firefox,Opera,IE & Safari(XP).
     
    Ajak, Nov 26, 2008 IP