Archived topic
change background when mobile menu is opened
3 replies · Started by Yannick on January 28, 2023
Hello guys,
I'm working on a project where i have a hamburger menu that's active when the screen is below 1028px. I've managed to change some things in css however not exactly how i want it.
Right now it looks like this : website right now
But when the hamburger menu is opened i would like to have the background over the whole screen of the user.
I tried so hard with css but i couldnt manage it hope you guys can help :)
Hi there,
to keep the Header visible then you could use some CSS to create a pseudo element overlay:
.mobile-menu-open .header-wrap:before {
content: '';
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: #323232;
}
This will appear behind the site header and fill the entire screen.
Hey man thats what i needed. Thankyou David!
You're welcome