【发布时间】:2012-08-08 23:07:56
【问题描述】:
我的 css 中有一个自定义样式用于我要应用的背景图像:
.specialbg {
background-image: url('http://i.imgur.com/XMuKF.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
我想将此样式应用于我在 HAML 中的 body 元素,但我不确定参数是如何设置的。我认为以下应该有效:
%html
%head
%body
.specialbg
但事实并非如此。我已经阅读了 haml 样式参考手册,但看不出我错在哪里——我刚刚采用了 haml,如果有任何帮助或指点,我将不胜感激!
我参考过的 Stack Q:
Background images do not render on Ruby on Rails application
【问题讨论】:
标签: css ruby-on-rails styles haml