Bootstrap 4 Nav Bar fixed-top over content

岁酱吖の 提交于 2019-12-04 21:28:42

The recommended method is padding-top on the BODY, the same height as the navbar...

body {
   padding-top: 56px;
}

From the Bootstrap 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."

I fixed this so now the content will always start after the fixed nav bar.

I added the below to the body css

min-height: 51.5rem;
padding-top: 2.5rem;

Thank you @ZimSystem for pointing me in the right direction.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!