How to make a row hover hilited ?

How to make a row hover hilited ?

verlagerverlager Posts: 18Questions: 3Answers: 0
edited May 2009 in General
What do I add to the css file to change the hover BG color?

This seems ineffective:
/*
* Row highlighting example
*/
.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted {
background-color: #ECFFB3;
}

.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted {
background-color: #E6FF99;
}

and: tbody tr:hover {background-color:red; color:#800000}
changes the foreground text, but not the BG.

Replies

  • allanallan Posts: 63,534Questions: 1Answers: 10,475 Site admin
    Hi verlager,

    It looks like the idea is right - using the :hover pseudo class. Do you have a .ex_heighlight element in your document - if not then the selector will fail. MRI from Westciv is a superb bookmarklet for testing selectors: http://westciv.com/mri/

    Regarding your second point, the reason this is failing is that you have a selector with a higher priority "table.display tr.even.gradeA" (assuming that this is for your chess site that you posted in the "How do you use..." topic) which is overriding the hover selector. You can either

    1. table.display tr.even.gradeA:hover ...
    2. Simplify your selectors to just use tr.odd, tr.event, tr.odd:hover and tr.even:hover

    Hope that helps,
    Allan
  • verlagerverlager Posts: 18Questions: 3Answers: 0
    Well the sort columns were unaffected, so I changed the font like so:

    tbody tr:hover {text-transform:uppercase; font-size:85%; color:#000000}

    which looks pretty snazzy at my chess site. It'll do. TY!
  • witsiwitwitsiwit Posts: 4Questions: 0Answers: 0
    hi,

    my is dynamically created and i already have the class="ex_highlight_row" but still no highlight is showing
This discussion has been closed.