How to do that when you hover on the line, it changed color?

This should be done without links and connecting tags <style></style> .

I write and nothing happens

 <tr onmouseover="this.style.backgroundColor='#555';" onmouseout="this.style.backgroundColor='#333';"></tr> <tr onmouseover="this.style.backgroundColor='#555';" onmouseout="this.style.backgroundColor='#333';"></tr> 
  • one
    The line shown by you works fine, the color changes, everything happens. If not, provide a minimal reproducible example and figure out how to use the local question editor. - andreymal
  • I was wrong, litter, there <tr> - KI MI
  • You were wrong, but not the point. In any case, if you put the tr in the table as expected, then everything works fine. - andreymal

2 answers 2

The table is supposed to have a certain structure: a table, in it are rows, in them are cells.

 <table style="border-collapse: collapse;"> <tr style="color:#800;border-bottom:1px solid blue;text-shadow: 2px 2px 2px rgba(1, 1, 1, 0.5);" onmouseover="this.style.backgroundColor='#555';" onmouseout="this.style.backgroundColor='#CCC';"> <td style="">Мне нужно сделать что бы при наведении на строку, она меняла цвет.</td> </tr> </table> 

  • <tr onmouseover = "this.style.backgroundColor = '# 555';" onmouseout = "this.style.backgroundColor = '# 333';" style = "border-top: none; border-bottom-: 1px solid # C1C3D1; color: # 252731; font-size: 16px; font-weight: normal; text-shadow: 0 1px 1px rgba (256, 256, 256 , 0.1); border-bottom: none "> - ki mi
  • @ Kimi is wonderful! What's this? - Igor

 <h1 onmouseover="this.style.color='#555';" onmouseout="this.style.color='#333';">Мне нужно сделать что бы при наведении на строку, она меняла цвет.</h1>