markwin markwin - 2 months ago 10
CSS Question

:hover#id on all web browser & devices - should work?

Normally we write this way:

#id span:hover {}

I tried this and it worked.

:hover#id span {}

Will this work in all web browsers and devices ?


Till this date I have used this in many browser, It works perfectly for me in every browser,

<div id="id">
     <a href="">hover me</a> 


  #id span:hover{
   color: red;

In this if you Hover on hello only hello will change the color

Now if you write CSS like

:hover#id span{
  color: red;

In this, where ever you hover inside #id, whole block will trigger, not only that particular span.