I created a very simple HTML table with 4 rows and 4 columns and I used Pure CSS to make it prettier.
Next, I wanted the table row to be highlighted when the user hovered over that row. I just added the code below into the <head>
tag:
<style>
tr:hover {background-color: #ffff99;}
</style>
The problem is that only the blank rows of the table are being highlighted. Lines that were gray, because of Pure CSS, remain gray.
Would anyone have any suggestions as to how I change the code so that the lines are highlighted when I hover over both the white and gray lines?
Follow the complete code:
<html>
<head>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
<style>
tr:hover {background-color: #ffff99;}
</style>
<title>Table</title>
</head>
<body>
<h1>Table</h1>
<table class="pure-table pure-table-striped">
<tr>
<td>A1</td>
<td>B1</td>
<td>C1</td>
<td>D1</td>
</tr>
<tr>
<td>A2</td>
<td>B2</td>
<td>C2</td>
<td>D2</td>
</tr>
<tr>
<td>A3</td>
<td>B3</td>
<td>C3</td>
<td>D3</td>
</tr>
<tr>
<td>A4</td>
<td>B4</td>
<td>C4</td>
<td>D4</td>
</tr>
</table>
</body>
</html>