Reputation: 225
This is my view table:
<tr>
<th><p>ID</p></th>
<th><p>NAME</p></th>
<th><p>CLASS</p></th>
<th><p>EDIT</p></th>
<th><p>DELETE</p></th>
</tr>
This is my css file:
table.mytable tr{
background-color: #ffff99;
}
For highlights rows using hover, it is not working for me. i don't know where i did wrongly kindly help on this issue?
Many thanks, viswa
Upvotes: 0
Views: 102
Reputation: 89
viswa.
To highlight on hover, you need to add the css for hover too. Since, you are enclosing your rows in <p>
tags, you can use the following in you css file.
p:hover{
background-color: #ffff99;
}
Make sure there is no space between : and the word 'hover'.
Upvotes: 0
Reputation: 3429
try this one:
ADD P:hover
selector to hover color:
p:hover{
background-color: #ffff99;
}
Thanks
OR
.mytable{
width:100%;
border-collapse:collapse;
border:#4e95f4 1px solid;
}
.mytable td{
padding:7px;
border:#4e95f4 1px solid;
}
.mytable tr{
background: #b8d1f3;
}
.mytable tr:hover {
background-color: #ffff99;
}
Upvotes: 0
Reputation: 6328
User :hover
selector to hover color:
table.mytable tr:hover{
background-color: #ffff99;
}
<table class="mytable">
<tr>
<th><p>ID</p></th>
<th><p>NAME</p></th>
<th><p>CLASS</p></th>
<th><p>EDIT</p></th>
<th><p>DELETE</p></th>
</tr>
<tr>
<td>1</td>
<td>ABC</td>
<td>2</td>
<td>edit</td>
<td>delete</td>
</tr>
</table>
Upvotes: 1