Site logo

Archived topic

change background when mobile menu is opened

3 replies · Started by Yannick on January 28, 2023

Viewing posts 1–4 of 4

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.

How i want it to be

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

This archived topic is closed to new replies.