Sticky nav margin css

Hi i want to create a sticky nav with margin at the top but sticky doesnt apply to margin spaces. Is there a work way around this? My current css is

.nav { position: sticky; display: flex; justify-content: space-between; align-items: center; width: 90%; margin: 3% auto 0 auto; z-index: 100; }

Welcome to our community!

Post your entire html and css code.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.