+ 1

How to hover a class and effect an other class ?

I want to effect a class by hovering an othe class How to do it ? Plz

24th May 2020, 10:13 PM
youssef soufiane
youssef soufiane - avatar
4 odpowiedzi
0
Somewhat like this? <style> .hovering{ height:100px; width:100px; background-color:blue; position:absolute; } .effected{ height:100px; width:100px; background-color:red; position:absolute; top:100px; left:20px; } .hovering:hover .effected{ left:120px; } </style> </head> <body> <div class="hovering"> <div class="effected"></div> </div>
24th May 2020, 10:45 PM
Abhay
Abhay - avatar
+ 1
Ah thank you so much 👍👍👍
24th May 2020, 10:56 PM
youssef soufiane
youssef soufiane - avatar
+ 1
yup I was having that div outside as well until I realised that I had to put it inside ,
24th May 2020, 11:07 PM
Abhay
Abhay - avatar
0
Thats why it didn't work because I didnt put the effected div inside the hovering
24th May 2020, 10:57 PM
youssef soufiane
youssef soufiane - avatar