Home >Web Front-end >HTML Tutorial >How to share the sample code of how to realize the color change of the entire row (tr) when the mouse is stopped in HTML

How to share the sample code of how to realize the color change of the entire row (tr) when the mouse is stopped in HTML

黄舟
黄舟Original
2017-06-18 13:48:461770browse

This article mainly introduces the relevant information in HTML to realize the discoloration of the entire row (tr) when the mouse passes over it. Friends in need can refer to the following

Using pure CSS to realize when the mouse passes over a table When a certain line of is placed, the background color of the entire line should change to indicate that the line is in focus:

<html >
<head>
<meta charset="utf-8"/>
<title>change</title>
<style type="text/css">
  tr.change:hover
  {
    background-color:#00FF00
  }
</style>
</head>
<body>
<h1>鼠标经停变色</h1>
<table width="80%" border="1" align="center">
  <tr class="change">
    <td> </td>
    <td> </td>
  </tr>
  <tr class="change">
    <td> </td>
    <td> </td>
  </tr>
</table>
</body>
</html>

The above is the detailed content of How to share the sample code of how to realize the color change of the entire row (tr) when the mouse is stopped in HTML. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn