2014-02-14 47 views
1

我已經建立了基於RailsTutorial的Ruby on Rails站點。我試圖改變幾種顏色,但我無法弄清楚。Bootstrap Rails - 更改背景顏色,無法正常工作?

我想改變背景顏色[頁面主體]和菜單文本的顏色。我在哪裏可以做到這一點?

我目前custom.css.scss:

@import "bootstrap"; 

/* mixins, variables, etc. */ 

$grayMediumLight: #eaeaea; 

@mixin box_sizing { 
    -moz-box-sizing: border-box; 
    -webkit-box-sizing: border-box; 
    box-sizing: border-box; 
} 

/* universal */ 

html { 
    overflow-y: scroll; 
} 

body { 
    padding-top: 60px; 
} 

section { 
    overflow: auto; 
} 

textarea { 
    resize: vertical; 
} 

.center { 
    text-align: center; 
    h1 { 
    margin-bottom: 10px; 
    } 
} 
table td { 
    padding:0px 25px 0px 0px; 
} 
table th { 
    text-align: left; 
    padding:0px 25px 0px 0px; 
} 



/* bootstrap */ 

.navbar-inner { 
    background-color: white; /* background color will be black for all browsers */ 
    background-image: none; 
    background-repeat: no-repeat; 
    filter: none; 
} 


/* typography */ 

h1, h2, h3, h4, h5, h6 { 
    line-height: 1; 
} 

h1 { 
    font-size: 3em; 
    letter-spacing: -2px; 
    margin-bottom: 30px; 
    text-align: center; 
} 

h2 { 
    font-size: 1.2em; 
    letter-spacing: -1px; 
    margin-bottom: 30px; 
    text-align: center; 
    font-weight: normal; 
    color: $grayLight; 
} 

p { 
    font-size: 1.1em; 
    line-height: 1.7em; 
} 
p2 { 
    font-size: 1.1em; 
    line-height:1.7em; 
    font-weight: bold; 
} 

/* header */ 

#logo { 
    float: left; 
    margin-right: 10px; 
    font-size: 1.7em; 
    color: black; 
    letter-spacing: -1px; 
    padding-top: 9px; 
    font-weight: bold; 
    line-height: 1; 
    &:hover { 
    color: white; 
    text-decoration: none; 
    background-color: black; 
    } 
} 
... 

感謝

回答

0

嘗試

div.navbar{ 
background: red; 
color:#fff 
} 

改變顏色您的需求。

1

改變導航欄

.navbar { 
    background-color: red; 
} 

的顏色來改變導航欄導航鏈接顏色

.navbar-nav > li > a { 
    color: blue; 
} 
+0

後悔什麼,我也不清楚。文本顏色工作,但身體的背景顏色(不導航欄)感謝 – Marcus

+0

那麼爲什麼不只是添加css在身體 –

+0

body {background-color:red; } –

1

引導默認有很多定製的。你可以在這裏找到所有的選項http://getbootstrap.com/customize/

只需使用sass變量而不是更少。

$body-bg: #fff; 

$navbar-default-color: #000; 

$navbar-default-link-color: #000; 

等等......你會得到你想要