将横幅放在Bootstrap 3 navbar上方? [英] Placing banner above the Bootstrap 3 navbar?

查看:378
本文介绍了将横幅放在Bootstrap 3 navbar上方?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个Bootstrap 3 navbar: http://www.bootply.com/xkcDjvQslb p>

我想进行以下修改:


  1. 在固定导航栏上添加横幅

  2. 向下滚动时隐藏横幅

我看到以下示例: http://www.bootply.com/69848 ;在引导时不大,当我拉相关代码它打破我的菜单。



横幅(导航栏上方)将是一个表左侧有一个标志,标题在右边。
我需要有人指向正确的方向吗?

解决方案

我找到了解决方案: http://jsfiddle.net/DTcHh/541/ ,只需清理我的代码:

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

#banner {
background-color:yellow;
}


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?

解决方案

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;   
}

这篇关于将横幅放在Bootstrap 3 navbar上方?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆