<!DOCTYPE html>
<html>
<head>
<title>W3.CSS(w3cschool.cn)</title>
<meta name="viewport" content="width=device-width, initial-scale=1" charset="UTF-8">
<link rel="stylesheet" href="https://7npmedia.w3cschool.cn/w3.css">
</head>
<body>
<div class="w3-container">
<h2>悬停颜色</h2>
<p>如果要使用特定的悬停颜色,请将 w3-hover-color 类添加到每个<tr>元素:</p>
<table class="w3-table-all">
<thead>
<tr class="w3-light-grey w3-hover-red">
<th>名字</th>
<th>姓</th>
<th>年龄</th>
</tr>
</thead>
<tr class="w3-hover-green">
<td>吉尔</td>
<td>史密斯</td>
<td>50</td>
</tr>
<tr class="w3-hover-blue">
<td>夏娃</td>
<td>杰克逊</td>
<td>94</td>
</tr>
<tr class="w3-hover-black">
<td>亚当</td>
<td>约翰逊</td>