当我给出背景图像路径时,我收到 Failed to load resource: the server responded with a status of 404 (Not Found)
错误:
body {
background-image: url('../../images/img.png') !important;
background-color: #d0dfe5 !important;
background-repeat: repeat;
font-size: 14px !important;
}
我不知道为什么会收到此错误。路径上有什么我需要改变的吗? 请帮助我。
最佳答案
问题是你的css中的路径
background-image: url('../../images/image.png') !important;
您在“personaltitania/WebContent/styles/personaltitania_base.css
”中,图像文件在“WebContent/images/
”中,但您返回了两个级别当您使用“../../
”时,此时您尝试在“personaltitania/images
”中找到图像“image.png”。
尝试使用
background-image: url('../images/image.png') !important;
而且,我在您的图像文件夹中没有看到文件“image.png”
关于html - 即使我使用 url ('../../images/image.png' 背景图像路径也不起作用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34459781/