【发布时间】:2016-08-24 14:44:31
【问题描述】:
我的 rails 项目的所有页面都有一个默认的图案背景。我正在尝试使用全屏背景图像设置根页面。加载后,这按预期工作。但是,当打开页面时,可以看到两步延迟,因为页面首先打开默认的彩色背景,然后将图像放在页面上。有没有办法我不能在这个视图上加载默认背景,以避免在加载过程中出现两步视图?
我已为我的根视图 (static_pages#index) 提供了一个#landing-page id。
CSS:
#landing-page {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
background: url(ripples.jpeg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
body {
background: url('congruent_pentagon.png');
}
【问题讨论】:
标签: html css ruby-on-rails background-image