2013-03-04 36 views
0

我使用Twitter的引導開發一個自適應網站....
當我降低了瀏覽器窗口導航欄崩潰....
但在倒塌的導航欄我的導航欄需要顯示的背景顏色....
但它顯示的背景圖像。如何使用background-color: #14486b;
取代它,我是從哪裏做這個回地面圖像肯定上來更換回地面顏色

<div class="nav-collapse in collapse" style="height: auto;"> 
      <ul class="nav"> 
       <li class="active"><a href="/docs/examples/product.html">Product</a></li> 
       <li><a href="/docs/examples/solution.html">Solutions</a></li> 
       <li><a href="/docs/examples/service.html">Services</a></li> 
       <li class="iphonePartnerLink"><a href="/docs/examples/partner.html">Partners</a></li> 
       <li class="iphoneContactLink"><a href="/docs/examples/contact.html">Contact</a></li> 
      </ul> 

      <ul class="nav" id="navSecond"> 
       <li class=""><a href="/docs/examples/partners.html">Partners</a></li> 
       <li><a href="/docs/examples/contact.html">Contact</a></li> 
      </ul> 
      <form class="navbar-form pull-right"> 
       <input class="span2" type="text" placeholder="Email"> 
       <input class="span2" type="password" placeholder="Password"> 
       <button type="submit" class="btn">Sign in</button> 
      </form> 
      </div> 
+0

提供鏈接,請... – henser 2013-03-04 22:24:15

+0

.navbar逆.navbar-內{ /*background-image:url('http://www.defie.co/designerImages/bg_bar.png');*/ 背景顏色:紅色; } – user2044139 2013-03-04 22:30:31

+0

你有一個導航欄,內格圍繞當前股利。 – Shail 2013-03-05 01:39:31

回答

0

嘗試分析中,當圖像的來源。 好工具這樣做是Firefox的Firebug https://addons.mozilla.org/de/firefox/addon/firebug/ 或Chrome的開發工具(在Chrome中按F12打開它)。在這兩種工具中,您都可以檢查DOM樹的單個元件,並查看所有附加的CSS樣式(及其來源)。

如果原因是背景圖像可以覆蓋風格以下列方式:

#idOfComponent { 
    background-image:none 
} 
0

你將不得不使用媒體查詢與背景顏色更換形象:

@media (min-width: 768px) and (max-width: 979px) { 

     .navbar-inner{ 
       background-image: url("http://www.defie.co/designerImages/bg_bar.png");/*remove this */ 
       background-color:#14486b; 
       } 

      } 

/* Landscape phone to portrait tablet */ 
    @media (max-width: 767px) { 

      .navbar-inner{ 
       background-image: url("http://www.defie.co/designerImages/bg_bar.png"); 
       background-color:#14486b; 
       } 
     } 

/* Landscape phones and down */ 
    @media (max-width: 480px) { 

      .navbar-inner{ 
       background-image: url("http://www.defie.co/designerImages/bg_bar.png"); 
       background-color:#14486b; 
       } 
     } 

如果要固定在頂部導航欄:

.navbar { 
left: 0; 
position: absolute;/*remove this line if you want to fix it */ 
right: 0; 
top: 0; 
    } 

編輯點評後:你已經設置你r background-image to none in media queries and the color is written out out like this:

@media (max-width:980px){ 
     .navbar-inverse .navbar-inner{ 
      background-image: none; 
      /*background-color: red;*/ 
     } 
     } 
@media (max-width: 767px) { 
    .navbar-inverse .navbar-inner { 
    background-image: none; 
    /*background-color: red;*/ 
    } 
    } 

    @media (max-width: 480px) { 
     .navbar-inverse .navbar-inner{ 
      background-image: none; 
      /*background-color: red;*/ 
     } 
     } 

請用上面提到的替換樣式。

+0

http://jsfiddle.net/rajkumart08/KNPZB/1/embedded/result/是的,它的工作原理它應該有一個背景圖片的主酒吧裏消失....如何解決它.... – user2044139 2013-03-05 01:41:20

+0

檢查更新的答案,這將解決 – Shail 2013-03-05 01:51:55

+0

至於我可以看到你希望把圖像的背景顏色就地。你想要什麼? – Shail 2013-03-05 02:06:17