1

Hello guys I have a very newbie question here but can't find a way to fix:

.parent {
  justify-content:left;

  .child__checkbox {
  // properties
  &:checked {
   justify-content:right;  
   } 
  }

When the .child__checkbox is checked, the .parent property should change from justify-content:left to justify-content:right without affecting the properties of .child__checkbox.

How do you do this?

tengxuanp
  • 177
  • 9
  • You should give an example including the basic HTML you're working with for a question like this. – paulo77 Jun 02 '22 at 16:30
  • https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector – Phix Jun 02 '22 at 18:56
  • Does this answer your question? [Is there a CSS parent selector?](https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector) – Arkellys Jun 03 '22 at 05:17

1 Answers1

1

In this case, javascript would be more apropriated, since as of now we dont have a way to affect a parent element like this that works across all browsers.

Fdamaso
  • 100
  • 8