I've noticed on sites like The New Yorker that when on mobile if you scroll to the very top and continue to scroll upwards the navbar stays firmly attached to the top of the window. On my site, the navbar stays connected to the rest of the content when I scroll up and continue past the body of the page. How would I go about emulating what The New Yorker does. I have looked at their page's css but can't seem to tell what gives that functionality. Any help would be appreciated.
setting the position:fixed
and top:0
to the navbar should work, although after that you will have to determine the height
occupied by the navbar and give your body content padding
set to that height to have a neat display. Please check this link : Why the paragraph is hidden behind navbar however navbar comes first in html source?