0
I have the body tag and the background color will be changed if there is a div.login as a daughter.
...
<body>
<div class="container"><div class="login"></div></div>
<body>
...
0
I have the body tag and the background color will be changed if there is a div.login as a daughter.
...
<body>
<div class="container"><div class="login"></div></div>
<body>
...
0
There are no Parent selectors in CSS.
There are several ways to dynamically select the parent of an element, but they all involve a bit of Javascript such as jQuery’s Parent() method.
Using SASS, you can do something using the ampersand operator:
Try to use:
div.container {
body & {
background-color: red;
}
}
I’m starting now, I don’t know if it’s the best way to be doing it. Test and see if it works. I hope I’ve helped!!
Browser other questions tagged sass
You are not signed in. Login or sign up in order to post.
with Sass I really could not, I did the process with javascript same. vlw
– fabiano.campos