Placing banner above the Bootstrap 3 navbar?

拥有回忆 提交于 2020-01-02 04:43:28

问题


I have this Bootstrap 3 navbar: http://www.bootply.com/xkcDjvQslb

I want the following modifications:

  1. Add banner above the fixed navbar
  2. Hide the banner when I scroll down

I saw the following example: http://www.bootply.com/69848; not great at bootstrap and when I pull the relevant code it breaks my menu.

The banner (above the navbar) would be a table with a logo on the left side and title on the right. I need someone to point me in the right direction?


回答1:


Remove navbar-fixed class in nav. Then place markup above the nav.

http://www.bootply.com/vxJEiv1RC2




回答2:


I found the solution here: http://jsfiddle.net/DTcHh/541/ , just needed to clean up my code:

topnavbar {
    margin: 0;
}
#topnavbar.affix {
    position: fixed;
    top: 0;
    width: 100%;
}

#banner {
     background-color: yellow;   
}


来源:https://stackoverflow.com/questions/27209336/placing-banner-above-the-bootstrap-3-navbar

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