So basically, I wanted to make a section with image as background. On top of it is text. The problem is; I tried every single way to put image as new <div.> or <img.>(using dots so it doesn't dissapear in post as code) but the only way it let's me style an image is if I put it as background of "main" div. Now I wanted to do hover animation but the problem is that it also changes text opacity and text color, not just background. When I was googling the problem it says that I should use ":not(*insert child class name)" and it won't alter it. The problem is the following code:
.main {
display: flex;
justify-content: center;
align-items: center;
height: 700px;
background-image: url(Images/Lavender\,\ Main\,\ Section\ 1\,\ Main\ Header.jpg);
background-repeat: no-repeat;
background-size: cover;
}
.main:hover :not(main__container) {
color: black;
opacity: 0.9;
transition: all 0.3 ease;
}
As you can see I tried using :not and in theory it should work fine. The problem is: It does the opposite. Instead of putting hover animation on "main" without "main__container" it changes text aka "main__container" but not "main" background...
Every help is appreciated.