What does navbar-static-top do in Bootstrap 3?

前端 未结 1 508
耶瑟儿~
耶瑟儿~ 2020-12-30 22:39

According to the documentation of the Bootstrap 3\'s navbar static-top,

Static top Create a full-width navbar that scrolls away with the page by add

相关标签:
1条回答
  • 2020-12-30 22:44

    navbar-static-top removes the left,right and top border created by navbar-default so that it looks better at the top of the page, whereas you might want to use just navbar-default elsewhere on the page...

    navbar-static-top: http://bootply.com/129342

    On the other hand, navbar-fixed-top uses position:fixed. If there is content on the page that extends below the viewport (as there is on most pages) the navbar-fixed-top will remain stuck to the top, whereas the navbar-static-top will scroll away. Since the navbar-fixed-top is fixed, it requires the body to have padding-top so that it doesn't overlay page content...

    navbar-fixed-top: http://bootply.com/129345

    As you can see when you scroll down in each example the top navbar responds differently.

    0 讨论(0)
提交回复
热议问题