Community forum for knowledge and support

Updated 7 months ago

Raising the navbar when the banner is closed

At a glance

The community member has added a banner above their navbar, and both have been set to 'fixed' positioning to make them float. The community member would like the navbar to raise up to the top of the screen if the banner is closed by the user. A comment suggests that instead of having two independently fixed divs, they should wrap them both into a single div and fix that div to the top. The comment states that in theory, when the banner is no longer visible, the navbar should just fill that spot.

Useful resources

Hey all, I've added a banner which I had above my navbar, however, I changed both the navbar and banner positions to be 'fixed' so they'd float, however I'd still like to have the navbar raise up to the top of the screen if the banner is closed by the user. Is this feasible? If so, how might I make this happen? https://preview.webflow.com/preview/sellstory2?utm_medium=preview_link&utm_source=desi[…]2&preview=6e9ea4b2000c4d81a59c6ddcf1cf5da1&workflow=preview

M
1 comment

i think we’ll want to rethink the structure of this. Instead having two divs independently fixed, we should wrap them both into a single div and fix that div to the top. And in theory when the banner is no longer visible the navbar should just fill that spot.

Add a reply
Sign up and join the conversation on Slack