绝对根url css

时间:2016-05-31 22:32:34

标签: html css

我需要在Images文件夹中使用此图像。 我在Content / style.css

中使用它

URL(' background.jpg&#39)

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

2 个答案:

答案 0 :(得分:1)

你的问题有点难以理解。如果你想用root引用一个图像,那么这样的东西就可以了:

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

url开头的/表示引用根。

答案 1 :(得分:1)

这应该有效

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