更新时间:2023-10-31 22:24:28
在CSS中:
td:hover {
background-color: #ff0000;
color: #000000;
}
或者您可以使用JavaScript / jQuery:
Or you can use JavaScript/jQuery:
$(document).ready(function() {
$("td").hover(
function() {
$(this).css('background-color', '#ff0000');
$(this).css('color', '#000000');
},
function() {
$(this).css('background-color', 'none');
$(this).css('color', 'black'); // or whatever your original color was
}
);
});