2014-10-07 103 views
0

這裏是在GitHub上一個Link to Source Code導航欄顏色Twitter的引導導軌

  • 我爲了學習一些軌道和這樣
  • 不過,我有麻煩不斷變化的顏色簡單的任務分叉項目設NavBar
  • 看來我要改變bootstrap_and_overrides.css.less沒有任何效果

我嘗試了好幾種方法。 。 。

... 
..... 
....... app/assets/stylesheets/bootstrap_and_overrides.css.less 
........... 
............. 


// Your custom LESS stylesheets goes here 
// 
// Since bootstrap was imported above you have access to its mixins which 
// you may use and inherit here 
// 
// If you'd like to override bootstrap's own variables, you can do so here as well 
// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation 
// 
// Example: 
// @linkColor: #036747; 


.navbar { 
    background-color: #A4C8EC; 
    background-image: none; 
} 

方法2

... 
..... 
....... 
........... 

.navbar-inverse .navbar-inner { 
    background-color: #FFFFFFF; 
    border-color: #252525; 
} 

方法3

... 
..... 
....... 
........... 

@navbarBackground: #ffffff; 

思想

  • 我確定我正在使用bootstrap或更少的變量以錯誤的方式。
  • 如果您需要更多的源代碼,它在GitHub - 鏈接頂部 頁面。

感謝

+1

你嘗試加入'!important'? – Dudo 2014-10-07 20:51:24

+1

你有沒有試過把頭撞在鍵盤上?這通常會讓我頭痛。 – 2014-10-07 21:39:41

+0

@Mallanaga我試着加入'!important'但沒有改變。 – 2014-10-08 04:47:29

回答

1

至於Mallanaga到您的信息的評論中提到的,你可以嘗試添加!important的CSS,所以:

.navbar-inverse .navbar-inner { 
    background-color: #FFFFFFF; 
    border-color: #252525; 
} 

變爲:

.navbar-inverse .navbar-inner { 
    background-color: #FFFFFFF !important; 
    border-color: #252525 !important; 
} 

另外,請仔細檢查您是否正在使用.navbar-inverse i你的HTML而不是.navbar-default

+0

添加'!important'沒有效果,但是我對html的引用不正確 – 2014-10-08 05:00:53

0

確保您的引導文件包含在您的application.css中,以便資產管道完整並且可以進行編輯!

application.css

/* 
* 
* require bootstrap 
* 
*/