【问题标题】:absolute root url css [closed]绝对根 url css [关闭]
【发布时间】:2016-06-01 07:40:31
【问题描述】:

我需要使用 Images 文件夹中的这张图片。 我在 Content/style.css 中使用它

url('background.jpg')

它显示以下错误:http://localhost:50260/Content/Images/background.jpg 404 (Not Found)

【问题讨论】:

标签: html css


【解决方案1】:

这应该可以工作

背景:url('../images/background.jpg');

【讨论】:

    【解决方案2】:

    您的问题有点难以理解。如果您想使用根目录引用图像,则可以使用以下方法:

    background: url('/images/background.jpg');
    

    url 开头的 / 表示引用根目录。

    【讨论】:

      猜你喜欢
      • 2012-09-18
      • 2014-04-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 2017-02-14
      • 1970-01-01
      • 2008-10-26
      相关资源
      最近更新 更多