我想在整个类区域(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-size
和color
工作,但background-color
似乎不起作用。
是作为背景颜色将只改变背景不是文本颜色,你已经使用的颜色 –