13 Replies
the problem I have is the background how to change the color when I click on the menu burger
code JS:
can I get some idea about what is going wrong ?
thanks by advance
first of all
SetProperty
needs to be setProperty
(lowercase s)
also, remove the semicolon ;
from the property value (hex color)
and you misspelled document
(single m)
(lots of errors in 1 single line 😉 )
so it should be document.documentElement.style.setProperty('--bg-color','#121214');
the rest is done within cssThanks for your answer I correct all
but it not working
you still have the uppercase S in setPropery
thanks
this is the final result https://codepen.io/alpha_66/pen/ExMKeKd
but something is going wrong on the div barre the background is black
yea, because
.barre
has background-color: var(--bg-color);
I remove it is still black
Is the body also black? Give your nav a bg color of white or your body a bg color of white
the body should be black only when I click on the burger menu but when I click on it the div who have barre class become also black that the probleme look how is it before I click on the burger menu
The barre element doesn't have a bg colour, its transparent so its background it whatever the body background is. Set a background-color: #fff; on the .barre (or whatever color you want it to be )
thanks solved