css3选择器如何能选取到紧邻的前一个元素?
PHP中文网
PHP中文网 2017-04-17 11:27:32
0
1
566

我知道css3选择其中'+'选择器可以取到元素紧邻的后面的元素,
我想知道用css如何选到元素紧邻的前一个元素,
情景是:需要table的一行tr :hover的时候,这个tr的前一个tr背景颜色改变

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
PHPzhong

It is better to use jquery to achieve this effect, and the animate method of the dom operation method can easily solve it. . .
In your situation, even if there is a corresponding selector, it cannot be solved
Css event processing does not allow chaining, and this has nothing to do with the selector
Css has not been selected before Element selector
If you must use css
I am afraid you can only use position:relative to displace the background
and in doing so you must abandon the table tags (use blocks for tr and td Level element replacement)
The content in each block must also be adjusted

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template