[英]Rails 3 application background-image and color pushed to bottom of page
I have build a standard Rails 3 application (using Ruby 1.9.2). 我已经构建了一个标准的Rails 3应用程序(使用Ruby 1.9.2)。
I placed all the links to my css files in the stylesheet_link_tag in the app/views/layouts/application.html.erb
file. 我将所有指向CSS文件的链接都放在了
app/views/layouts/application.html.erb
文件的stylesheet_link_tag中。 When I run the application all the styles in the css files work except that the background-image and color are pushed below the content from the view content from the model views in the app/views folders instead of laying on top of the image and color. 当我运行应用程序时,css文件中的所有样式都起作用,除了背景图像和颜色被推送到app / views文件夹中的模型视图的视图内容的内容下方,而不是放置在图像和颜色的顶部。 In my css file I have the background-image attached to the html tag (code below).
在我的css文件中,我将背景图像附加到html标签(下面的代码)。
html {
background-color:#ccdbce;
background-image: url('images/bg-body.png');
background-repeat: repeat;
background-position: top;
color:#444;
}
Please let me know what I am doing wrong? 请让我知道我在做什么错?
Try the following small modification to the background-position: 尝试对背景位置进行以下小的修改:
html {
background-color:#ccdbce;
background-image: url('images/bg-body.png');
background-repeat: repeat;
background-position: left top;
color:#444;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.