2014-07-27 31 views
0

我想在整个类区域(class =“test_detail”)中更改背景颜色,但仅改变文本背后的颜色。如何将背景颜色应用到整个类的区域

我使用Rails的4

index.html.erb

. 
. 
. 
<% @calendar.each do |c| %> 
. 
. 
. 
<aside class="span7"> 
    <span class="test_detail"> 
     <% if c.day? %> 
     <%= c.day %> 
     <% else %> 
     xxx 
     <% end %> 
     <br> 
     xxx <%= link_to "xxx", 'http://xxx' %> 
    </span> 
</aside> 
. 
. 
. 
<% end %> 

custom.css.scss

.test_detail { 
    font-size: 12px; 
    color: gray; 
    background-color: orange; 
} 

font-sizecolor工作,但background-color似乎不起作用。

+0

是作为背景颜色将只改变背景不是文本颜色,你已经使用的颜色 –

回答

相关问题