Your answer is right in the docs:
Body padding required
The fixed navbar will overlay your other content, unless you add
padding
to the top of the<body>
. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.body { padding-top: 70px; }
Make sure to include this after the core Bootstrap CSS.
and in the Bootstrap 4 docs…
Fixed navbars use position: fixed, meaning they’re pulled from the
normal flow of the DOM and may require custom CSS (e.g., padding-top
on the ) to prevent overlap with other elements.