在css中设置背景路径的问题 [英] problem in setting path of background in css

查看:83
本文介绍了在css中设置背景路径的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目文件夹中有一个图像,然后在Admin文件夹中有一个图像,然后在images文件夹中有一个图像

如何在CSS中调用它

i have a image in my project folder then Admin folder then images folder

how can i call it in css

background-image:url(./admin/images/yello.jpg);


谁能纠正我


can anyone correct me

推荐答案

使用,

Use,

background-image: url(''../admin/images/yello.jpg'');


什么意思不起作用"?请更精确地指定.

您可以尝试以下操作:
What means "does not work"? Please specify more precisely.

You may try the following:

  1. 确保每次尝试都不要从缓存中加载页面(这种问题过去使我发疯了)
  2. 简单地放弃./或../使用相对路径(例如admin/images/yello.jpg)
  3. 尝试通过在浏览器中输入路径来加载jpeg文件(如果失败,请修复该路径并在CSS中使用它)
  4. 如果上述所有方法均无效:请提供更多详细信息,以便我们提供更多具体建议;-)

  1. make sure that with each trial that you don''t load the page from cache (this kind of problem drove me crazy in the past)
  2. leave away the ./ or ../, simply use the relative path (e.g. admin/images/yello.jpg)
  3. try to load the jpeg file by entering the path in your browser (if this fails, fix the path and use it in your CSS)
  4. if the above all fails: give more detail so that we can give more prcise advise ;-)



干杯

Andi



Cheers

Andi


使用此
background-image:url('~/admin/images/yello.jpg');


这篇关于在css中设置背景路径的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆