Not able to make Nav bar Stick to the top

I am not able to make the navbar stick to the top when scrolling. Can anyone help me?

why these two navbars are showing as components? Initially i had one navbar component, now I don’t know how I got two.

Have you tried setting the position to “sticky”?

Yes. I even made it sticky but still it was not getting sticky

Can you please show the layers of the page with the navbar?

It is working now. Thanks