markwin markwin - 1 year ago 97
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 ?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download