简体   繁体   English

在Twitter引导程序中的导航栏下方添加图片

[英]Add image below navbar in Twitter bootstrap

I'm facing a problem with Bootstrap due to lines: 由于行而导致我遇到Bootstrap问题:

<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <a class="brand" href="/"></a>
        </div>
    </div>
</div>

<div id="main_top">
    <div class="container">
        <div class="row">
            <div class="span12">
                            ...

In the main_top I have a background image. 在main_top中,我有一个背景图像。 The problem happens when I resize the browser due to the following code: 由于以下代码而导致我调整浏览器大小时会发生问题:

@media (max-width: 979px)
.navbar-fixed-top {
margin-bottom: 20px;
}

Basically, when browser width < 979, there's a white line due to 20px margin. 基本上,当浏览器宽度<979时,由于20px的空白,会有一条白线。

Could you help me to fix it? 你能帮我解决吗? I also created a sample here: http://jsfiddle.net/TxRgF/ 我还在这里创建了一个示例: http : //jsfiddle.net/TxRgF/

Working DEMO 工作演示

What about this: 那这个呢:

@media (max-width: 979px){
    body{
      padding-left:0 !important;
      padding-right: 0 !important;
    }

   .navbar-fixed-top {
      margin-bottom: 0px !important;
   } 

}

At that width, the body has left and right padding. 在该宽度下,主体具有左右填充物。 Add this class at the end of your CSS. 在CSS的末尾添加此类。

@media (max-width: 767px){
  body {
   padding-left:0 !important;
   padding-right: 0 !important;
 }
}

http://jsfiddle.net/simply_simpy/ryjMT/2/ http://jsfiddle.net/simply_simpy/ryjMT/2/

You will need to add padding to other elements to compensate. 您将需要向其他元素添加填充以进行补偿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM