我正在使用 Bootstrap 编写 Rails 应用程序。我想为它设置一个图像背景,我已经使用override.css.scss
文件完成了。app/assets/images/
查看文件夹中我的图像时,背景显示为白色。
如果我将图像设置为外部资源,则显示正常。
用本地图像覆盖的 CSS:
html, body {
padding-top: 60px;
background-image: url('app/assets/images/nyc.png');
/* background-repeat: no-repeat; */
background-color: transparent;
height: 1000px;
}
用外部图像覆盖的 CSS:
html, body {
padding-top: 60px;
background-image: url('http://www.google.com/intl/en_com/images/srpr/logo3w.png');
/* background-repeat: no-repeat; */
background-color: transparent;
height: 1000px;
}
莫名其妙。