How do i get it so when the menu is checked the welcome message gets hidden
9 Replies
the menu button is food menu btw
the button
It depends on how you actually want to hide it.
The simplest method is just to use display: none;
This selector will of course only work if the "welcome-msg" element is a sibling of the checkbox.
ive tried that
im guessing its not a sibling
i cant send the css bcs its too long
ok, so the
~
selector will only work on siblings so you will need to adjust the selector.
Firstly your <nav> needs to be within the body (this is just a copy & paste mistake).
Then, as your checkbox is within a container, you won't be able to use a direct sibling selector however your could use the :has()
selector on the parent (nav) and then use the sibling selector on that.
okay cool
im going to use opacity 0 but itll have the same effect surely
oh wait
it wont
You can use opacity but bear in mind that it will still be there so it could interfere with the mouse etc. You could add
pointer-events: none;
to negate this.
You could also add the :has()
selector on the body and find the message element directly without worrying about siblings.