Sometimes, we want to fix Twitter Bootstrap navbar fixed top overlapping site with CSS.
In this article, we’ll look at how to fix Twitter Bootstrap navbar fixed top overlapping site with CSS.
How to fix Twitter Bootstrap navbar fixed top overlapping site with CSS?
To fix Twitter Bootstrap navbar fixed top overlapping site with CSS, we add padding to the body.
For instance, we write
body {
padding-top: 40px;
}
@media screen and (max-width: 768px) {
body {
padding-top: 0px;
}
}
to add the padding-top style to the body if the screen is wide.
Otherwise, we make the padding-top 0 if the screen has max width 767px or less.
Conclusion
To fix Twitter Bootstrap navbar fixed top overlapping site with CSS, we add padding to the body.