HTML CSS examples for CSS Widget:Hover class
Check the difference between (.class a:hover) vs (.class:hover a)
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> .hvr,<!--from w w w. j a v a 2 s .c o m--> .hvr2 { background:grey; padding:11px; margin:0 0 21px } .hvr:hover a { color:Chartreuse; } .hvr2 a:hover { color:yellow; } </style> </head> <body> <div class="hvr"> <a href="#">link1: class2:hover a {}</a> <div> Hover style for <a> will be triggered if .hvr div is hovered </div> </div> <div class="hvr2"> <a href="#">link2: .class2 a:hover {}</a> <div> Hover style for a will only be triggered if <a> is hovered specifically </div> </div> </body> </html>