weird behavior in <tr> element

Viewed 24

i don't know why the shadow is drawn under the other next element removing this line:

tr:nth-child(odd){background-color: #f2f2f2}

solves the problem
tested on Firefox and Brave :

tr{background-color:white;width:100%}
tr:nth-child(odd){background-color: #f2f2f2}
tr:nth-child(2){box-shadow : 0px 0px 5px 5px rgba(56,186,180,0.6);}
table{
        border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 8px;
  border-right: 1px solid #f2f2f2;
}

th {
  background-color: #f5c000;
  color: white;
}
#tr:first-child{
  width:10px;

}
<!DOCTYPE html>
<html>
    <body>
        <table>
               <tr>
                    <td>
                        Lorem ipsum
                    </td>                
                    <td>
                        Lorem ipsum
                    </td>
                    <td>
                        Lorem ipsum
                    </td>
                    <td>
                        Lorem ipsum
                    </td>

            </tr>
            <tr>
                <td>
                    Lorem ipsum
                </td>                
                <td>
                    Lorem ipsum
                </td>
                <td>
                    Lorem ipsum
                </td>
                <td>
                    Lorem ipsum
                </td>

            </tr>
            <tr>
                <td>
                    Lorem ipsum
                </td>                
                <td>
                    Lorem ipsum
                </td>
                <td>
                    Lorem ipsum
                </td>
                <td>
                    Lorem ipsum
                </td>

            </tr>
       </table>
    </body>


</html>

i want to use the shadow to indicate the selected element

0 Answers
Related