好的,这就是我要在这里实现的目标。
我有这个板子,我正在尝试设计它的样式,
当我将鼠标悬停在 <tr>
上时,我要给color:#fff
到 <a>
那是在<tr>
里面我在徘徊。
如果我给它是行不通的
tr:hover {color:#fff}
有什么办法可以实现吗?
我似乎找不到合适的选择器。
这是我正在处理的网站 http://lifeto.cafe24.com/xe/request .
最佳答案
试试这个,
tr {
background: #eee;
}
tr:hover {
background: #333;
}
tr:hover a {
color: #fff;
}
<table>
<tr>
<td><a href="#">Link 1</a>
</td>
<td><a href="#">Link 2</a>
</td>
</tr>
</table>
关于css - 我如何给 :hover selection to other elements when I'm actually hovering on something other than the element I'm giving the style to?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35113695/