Changing CSS of a div when hovering on some other div
By Asim Krishna Prasad
Posted on 18/11/14
Tag :
CSS
Here we are going to see how we can change the css of a div while hovering on some other div and hence give a cool effect to the website..
Let us divide this post into two parts. First, when the two divs are placed one-after-the-other in HTML code and Second, when one div is nested inside the other one in the HTML code..
1)When two divs are placed one-after-the-other
Let us take two divisions, source and destination..
Our aim is to hover on the source div and change the css of the destination div..
For this we use the "+" sign in the CSS.. See the example HTML & CSS codes
You can play with the code here
2)When one div is nested inside the other
Let us take two divisions, source and destination where the destination div is nested inside the source div..
Our aim is to hover on the source div and change the css of the destination div..
For this we use the ">" sign in the CSS.. See the example HTML & CSS codes
You can play with the code here
Hope it helps..
Asim Krishna Prasad
COMMENTS :