1 reply [Last post]
ARNK
ARNK's picture
Offline
newbie
Last seen: 7 weeks 4 days ago
Timezone: GMT-5
Joined: 2016-12-04
Posts: 2
Points: 4

So I'm reading Eric Meyer's book on CSS. In it, he gives the example:

body *:hover { background: yellow; } which in theory should produce a yellow background for any element that's descended from the body element to display a yellow background. It doesn't however, in Chrome, Firefox or Edge.

I'm just getting back into CSS and I know things change quickly, is there a simple workaround for this behavior? I may be missing something.

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 16 hours 26 min ago
Dallas
Timezone: GMT-6
Joined: 2004-06-25
Posts: 9621
Points: 3689

space?

Did you put a space between body and *? If not, you don't have what you described. Read up on the descendant selector.

Since you're reading Meyer, you should read Global resets considered harmful.

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.