【发布时间】:2019-08-24 12:47:11
【问题描述】:
图像没有从用于背景的 CSS 文件加载,但在 jsx 中它正在加载
在 CSS 文件中,我使用如下
.main-banner {
position: relative;
height: 910px;
z-index: 1;
background: transparent url(../../static/images/banner-bg1.jpg) right top no-repeat;
}
图片网址绝对没问题
还有这样的配置文件
//next.config.js
const withImages = require('next-images');
const withCSS = require('@zeit/next-css')
module.exports = withImages(withCSS({
cssLoaderOptions: {
url: false
}
}))
究竟是什么问题?
谢谢
【问题讨论】:
-
不应该只是“url(/static/images/banner-bg1.jpg) as of: github.com/zeit/next.js/issues/1935