How can i HOVER something and another thing is affected ?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i HOVER something and another thing is affected ??

-------ONLY USING CSS ----' i have 'div1' and 'div2' and i want to change the style of "div1" by hover over "div2" .. NOTE THAT :- the two divs are not linked not father and child but just ordinary divs

29th Jun 2017, 6:18 PM
Mohammed Salem
Mohammed Salem - avatar
6 Answers
+ 5
well I think if its under a few divs after it like <div id="div1"></div> <div></div> <div></div> <div></div> <div id="div2"></div> you could just repeat #div1: hover + div +div +div + #div2 { /* css */ } I'm not entirely sure about this one
30th Jun 2017, 11:23 PM
MCJEH
MCJEH - avatar
+ 7
I think if they are one right after another like <div id="div1"></div> <div id="div2"></div> it would be #div1: hover + #div2 { /* css */ } if that doesn't work then I'm not sure
29th Jun 2017, 6:36 PM
MCJEH
MCJEH - avatar
+ 1
U R right bro 😃 thank U
29th Jun 2017, 8:23 PM
Mohammed Salem
Mohammed Salem - avatar
0
this way is right only if div1 is directly before div2 😢
30th Jun 2017, 11:11 PM
Mohammed Salem
Mohammed Salem - avatar
0
YES you are right again 👍💓 https://code.sololearn.com/WgRQEQwRSr49/?ref=app
30th Jun 2017, 11:40 PM
Mohammed Salem
Mohammed Salem - avatar
0
give me an example !
1st Jul 2017, 11:41 AM
Mohammed Salem
Mohammed Salem - avatar