There is a table on the styles, the tr:hover line highlighting is registered in the default style, everything is cool - it is convenient and works, BUT there are times when the highlighting is not needed, what should I do to turn off highlighting for certain rows?

Closed due to the fact that the essence of the issue is not clear to the participants Yuri , Regent , user194374, ߊߚߤߘ , Grundy 7 Feb '17 at 14:45 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • five
    Likely with the TELEPATHY method we should guess at what moments the backlight should not work? )) you can at least write under what actions there should be no highlighting ....)) - Arsen
  • Um ... Where to register? In what situations? Why can't you add an importent? - Yuri
  • 2
    apparently there should only be tr:hover:nth-child(ТУТ_УСЛОВИЕ) - Alexey Shimansky

2 answers 2

You did not give enough source data, so my answer is very general:

The easiest way is to mark the desired string with the class. Suppose we call it nohover . Then we need to make a selector that cancels the tr:hover action. If, for example, the backlight is spelled out like this:

 .hovertable tr:hover { background: lightgray; } 

Then you need to add the class .nohover :

 .hovertable tr.nohover:hover { 

and background off:

 background: none; 

Working example:

 .hovertable tr:hover { background: lightgray; } .hovertable tr.nohover:hover { background: none; } 
 <table class="hovertable" width="100%"> <tr> <td>Обычная строка</td> </tr> <tr class="nohover"> <td>Строка у которой убрана подсветка</td> </tr> <tr> <td>Обычная строка</td> </tr> </table> 

    use the nth-of-type selector (condition)

    • 2
      I recommend for the future to write more detailed answers. Yes, that's the next answer from Crantisz, at least look as a sample. And as short as you usually do not plus. Least. And sometimes a minus can deliver. - AK