Is there a selector for selecting previous sibling elements?
P粉512363233
P粉512363233 2023-10-09 22:04:19

The plus selector ( ) is used to select the next adjacent sibling.

Is there an equivalent to the previous sibling?

P粉512363233
P粉512363233

reply all(2)
P粉486743671

I found a way to style all previous siblings (as opposed to ~) that might work depending on your needs.

Suppose you have a list of links, when the mouse is hovering over one of the links, all the previous links should turn red. You can do this:

Latest downloads
More>
web effects
Website source code
Website materials
Front end template
About us Disclaimer Sitemap
PHP Chinese website:Public welfare online PHP training,Help PHP learners grow quickly!