如何仅使用CSS在悬停时突出显示表格行?

dem*_*mas 35 html css

是否可以使用CSS(不使用JavaScript)突出显示悬停上的表格行(类似于此内容)?

Emi*_*röm 61

是的,可以行但不是列.

tr:hover {
  background-color: lightyellow;
}
Run Code Online (Sandbox Code Playgroud)


wut*_*aer 6

适用于大多数浏览器

table tr:hover td {
  background: #efefef;
  cursor: pointer;
}
Run Code Online (Sandbox Code Playgroud)