Home CSS - Change body Background Image on DIV Hover
Reply: 0

CSS - Change body Background Image on DIV Hover

user984
1#
user984 Published in April 26, 2018, 1:40 pm

This question already has an answer here:

  • Is there a CSS parent selector? 27 answers

Not too sure where to begin with this one. So I have my DIVS on the page in the position I want them.

It's worth noting this is using CSS Grids.

So long story short, all I want to know is, Can i change the background of the body element on the page when I hover over a particular div?

I have a Fiddle setup to assist in understanding the problem.

Fiddle: https://jsfiddle.net/bqnw4qyb/

Originally, I thought this COULD work:

.div:hover {
    body {
       background-color: red;
    }
}

But it appears this does not work.

Any thoughts?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.453628 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO