How to change the color of the entire row (tr) when the mouse stops in HTML

How to change the color of the entire row (tr) when the mouse stops in HTML

Use pure CSS to change the background color of a row when the mouse passes over it to indicate that the row 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>Change color when the mouse is stopped</h1>
<table width="80%" border="1" align="center">
  <tr class="change">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr class="change">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

The above is what I introduced to you about how to change the color of the entire row (tr) when the mouse stops in HTML. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  A brief analysis of JS original value and reference value issues

>>:  In-depth study of MySQL multi-version concurrency control MVCC

Recommend

How to detect Ubuntu version using command line

Method 1: Use the lsb_release utility The lsb_rel...

Summary of uncommon js operation operators

Table of contents 2. Comma operator 3. JavaScript...

Example code for implementing card waterfall layout with css3 column

This article introduces the sample code of CSS3 c...

MySQL online deadlock analysis practice

Preface I believe that everyone has had a simple ...

Mysql optimization tool (recommended)

Preface While browsing GitHub today, I found this...

Summary of common MySQL table design errors

Table of contents Mistake 1: Too many columns of ...

How to dynamically add ports to Docker without rebuilding the image

Sometimes you may need to modify or add exposed p...

How to automatically delete records before a specified time in Mysql

About Event: MySQL 5.1 began to introduce the con...

HTML simple web form creation example introduction

<input> is used to collect user information ...

Summary of the data storage structure of the nginx http module

Starting from this section, we will explain the i...

Example of building a Jenkins service with Docker

Pull the image root@EricZhou-MateBookProX: docker...

How to implement dual-machine master and backup with Nginx+Keepalived

Preface First, let me introduce Keepalived, which...

Practice of dynamically creating dialog according to file name in vue+el-element

Table of contents background accomplish 1. Encaps...

Express implements login verification

This article example shares the specific code for...