【发布时间】:2016-06-01 07:40:31
【问题描述】:
我需要使用 Images 文件夹中的这张图片。 我在 Content/style.css 中使用它
url('background.jpg')
它显示以下错误:http://localhost:50260/Content/Images/background.jpg 404 (Not Found)
【问题讨论】:
我需要使用 Images 文件夹中的这张图片。 我在 Content/style.css 中使用它
url('background.jpg')
它显示以下错误:http://localhost:50260/Content/Images/background.jpg 404 (Not Found)
【问题讨论】:
这应该可以工作
背景:url('../images/background.jpg');
【讨论】:
您的问题有点难以理解。如果您想使用根目录引用图像,则可以使用以下方法:
background: url('/images/background.jpg');
url 开头的 / 表示引用根目录。
【讨论】: