gpt4 book ai didi

html - 悬停时无法使表行更改颜色

转载 作者:太空宇宙 更新时间:2023-11-03 22:54:50 25 4
gpt4 key购买 nike

我为表格数据制作了悬停换色器,但我想在悬停时为整个表格行更改它,但是当我将 td:hover 更改为 tr:hover 时它不起作用。我究竟做错了什么?

JsFiddle:https://jsfiddle.net/uwvvmpok/

HTML:

   <div class="content">
<div class="header">
</div>

<a name="172016">
<!--1. riadok H-->
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<th width="50px">C. u.</th>
<th width="30px">Zobrazit</th>
<th width="30px">Typ</th>
<th width="200px">Cislo/Meno</th>
<th width="600px">Popis</th>
<th width="130px">System</th>
<th width="100px">Dopad/Symptom</th>
<th width="100px">Dátum zadania</th>
<th width="100px">Dátum vzniku</th>
<th width="100px">Datum Verifikacie</th>
<th width="80px">Ukoncenie</th>
<th width="500px">Komentár</th>
<th width="100px">Dátum</th>
<th width="60px">Počet</th>
</tr>
<!--2. riadok D-->
<tr>
<td style="text-align:center;background-color: #d0f5f6">100</td>
<td style="text-align:center">X</td>
<td style="text-align:center">C </td>
<td>DOBRIKOVA/DURACKA</td>
<td class="tooltip">Gefco PC nasa siet CD vs finalne riesenie internet gefco pc CORAIL <span class="ttext">ked sa vytvara uplne novu hypotheza tak nefunguje vyber tlaciarni a globalny export tiez NOK (nepouzivame)</span> </td>
<td>CORAIL/CONSO</td>
<td></td>
<td class="DZ">06/07/2016</td>
<td class="DZ">06/07/2016</td>
<td class="DZ">06/07/2016</td>
<td style="text-align:center">OK</td>
<td>ked sa vytvara uplne novu hypotheza tak nefunguje vyber tlaciarni a globalny export tiez NOK (nepouzivame)</td>
<td style="text-align:center">07/07/2016</td>
<td style="text-align:center">2</td>
</tr>

CSS:

.content {
position: static;
}

.header {
text-align: center;
position: relative;
margin-top: 40px;
}


th, td{
border:1px solid black;
overflow: hidden;
}

th{
background-color: #eff0f0;
}

td{
background-color: #eed6b1;
height: 50px;
}
table{
table-layout: fixed;
min-width: 2000px;
border-collapse: collapse;
width: 100%;
margin-left: 5px;
}

.DZ {
text-align: center;
}


td:hover{
background-color: #b0b0b0;
}

最佳答案

尝试在悬停该行时更改 td 的背景颜色。

tr:hover td {
background: #b0b0b0;
}

https://jsfiddle.net/j0aj1p80/

关于html - 悬停时无法使表行更改颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38820172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com