Selecting adjacent elements on :hover with CSS
I wanted to lighten and shrink buttons adjacent to the button that I am hovering over. But some of the buttons are inside a containing 'div'. For example, I have 2 'div' elements with CSS class 'outer', and each 'div' contains 'input' elements which have a CSS class 'inner'. So I first say: .inner:hover ~ .inner, .inner:has(~ .inner:hover) { opacity: 0.7; transform: scale3d(0.9,0.9,1); } The above works for 'inner' elements within the same 'outer' element. The '~' is the 'sibling selector'. Then for the 'hover' to affect following 'outer' elements: .outer:has(.inner:hover) ~ .outer .inner { opacity: 0.7; transform: scale3d(0.9,0.9,1); } The above saya: "if an 'outer' element has an 'inner' child that is being hovered over, and is followed by an 'outer' element then apply t...