App下載
首頁(yè)htmltdHTML Element Style - 如何懸停以更改表單元格邊框

HTML Element Style - 如何懸停以更改表單元格邊框

我們想知道如何懸停以更改表單元格邊框。

<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
table {
  border-collapse: separate;
  border-spacing: 0;
}

td {
  border: 1px solid #000;
}

tr:hover td {
  border-color: #F55;
}
</style>
</head>
<body>
  <table>
    <th>AAA</th>
    <th>BBB</th>
    <th>CCC</th>
    <tr>
      <td>AAA</td>
      <td>BBB</td>
      <td>CCC</td>
    </tr>
    <tr>
      <td>AAA</td>
      <td>BBB</td>
      <td>CCC</td>
    </tr>
    <tr>
      <td>AAA</td>
      <td>BBB</td>
      <td>CCC</td>
    </tr>
  </table>
</body>
</html>