在CSS中打破了相对URL

时间:2012-09-18 09:02:24

标签: html5 css3

在外部项目的每个css中,我必须像这样替换url:

url(image.jpg)

url(../image.jpg)

也许这与我必须包含尾随斜杠的css的方式有关:

<link rel="stylesheet" type="text/css" href="/project1/style.css/"  th:href="@{ /project1/style.css/ }" />

1 个答案:

答案 0 :(得分:2)

您无需添加额外的/

试试这个:

<link rel="stylesheet" type="text/css" href="/css/style.css"   th:href="@{ /css/style.css }" />