SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    New to css adding link class.

    Hi everyone I have a table like this

    tr.odd td {
    background: #F6F4EB;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #333333;
    text-decoration: none;
    }
    for this table only i want to define the link colors alink ahover etc, how can i do it.

    Thanks in advance.

  2. #2
    SitePoint Zealot stikkybubble's Avatar
    Join Date
    Sep 2006
    Location
    Pluto
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.w3.org/TR/CSS21/selector....pseudo-classes

    ie
    a:link { blah blah }
    etc

    remember to put them in the right order.
    If you are trying to make the whole td change colour, things can get a little tricky. If your td is just the default size to contain your links though, it should be OK.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2008
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your reply but i just want to apply a:link to the specific table not the whole look of the site.

  4. #4
    SitePoint Zealot stikkybubble's Avatar
    Join Date
    Sep 2006
    Location
    Pluto
    Posts
    182
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah I see where you are stuck now.
    This works:

    td>a:link {color:#000;}
    td>a:visited {color:#fff;}
    td>a:active {color:#888800;}
    td>a:hover {color:#000088;}

    or you could apply the styling to the <table> element, or give the table / cells id's or class names.

    PS I think that would be eg <table id="linktable" >
    table#linktable>a:link {color: #000;}


Bookmarks

Posting Permissions

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