【问题标题】:Rails 3 application background-image and color pushed to bottom of pageRails 3应用程序背景图像和颜色推到页面底部
【发布时间】:2011-03-14 16:34:17
【问题描述】:

我已经构建了一个标准 Rails 3 应用程序(使用 Ruby 1.9.2)。

我将所有指向我的 css 文件的链接放在 app/views/layouts/application.html.erb 文件的 stylesheet_link_tag 中。当我运行应用程序时,css文件中的所有样式都可以工作,除了背景图像和颜色被推到app/views文件夹中模型视图的视图内容的内容下方,而不是放在图像和颜色的顶部.在我的 css 文件中,我将背景图像附加到 html 标记(下面的代码)。

html {
      background-color:#ccdbce;
      background-image: url('images/bg-body.png');
      background-repeat: repeat;
      background-position: top;
      color:#444;
}

请让我知道我做错了什么?

【问题讨论】:

  • 附加显示当前输出和所需输出的图像。

标签: html ruby-on-rails css


【解决方案1】:

尝试对背景位置进行以下小修改:

html {
      background-color:#ccdbce;
      background-image: url('images/bg-body.png');
      background-repeat: repeat;
      background-position: left top;
      color:#444;
}

【讨论】:

  • 感谢您的回答。我对代码进行了更改,但所有内容仍保留在页面底部。
猜你喜欢
  • 2012-07-14
  • 2013-02-25
  • 1970-01-01
  • 2016-03-23
  • 1970-01-01
  • 1970-01-01
  • 2021-09-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多