Results 1 to 3 of 3

Thread: Please help with css table!

  1. #1
    Join Date
    Nov 2008

    Please help with css table!

    Hey guys, I have a table on my html page. I have links in this table, and am trying to change a{hover:} color only in that table, not the entire page. How would i go about doing that.
    THanks much!

  2. #2
    Join Date
    Mar 2007
    assign a class to the links in the table

  3. #3
    Join Date
    May 2008
    You could assign the table an id if possible, or if you anticipate multiple tables using the same style, a class. Then use one of the following in your CSS:
    table#someID a:hover { color: <color here> }
    table.someClass a:hover { color: <color here> }
    That would be a lot faster than assigning classes to each individual link in the table. On the other hand, if you only have certain links in the table that you want to do this with, use skywalker2008's suggestion and apply a class on the links directly rather than using the table.

    There are a few ways to do this, honestly. Given a two-column table where both columns have links, you could do one of the following:
    • Style all of the links of the table by applying a selector globally (like I showed above)
    • Style the links in the second column via a class and leave the first column untouched (or vice-versa)
    • Make the default hover for the links your color and override the color for the other links via a class.

    Remember, it's your choice. ^_^
    Last edited by rpgfan3233; 11-16-2008 at 12:05 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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