Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html css中断开的相对url_Html_Css - Fatal编程技术网

Html css中断开的相对url

Html css中断开的相对url,html,css,Html,Css,在每个来自外部项目的css中,我必须像这样替换url: url(image.jpg) 到 也许这与我必须包含带有尾随斜杠的css的方式有关: <link rel="stylesheet" type="text/css" href="/project1/style.css/" th:href="@{ /project1/style.css/ }" /> 您不需要包含额外的/ 试试这个: <link rel="stylesheet" type="text/css" href=

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

url(image.jpg)

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

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

您不需要包含额外的
/

试试这个:

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


您甚至可以尝试不使用第一个斜杠牙槽,以前没有尾部斜杠就不行,现在可以了。我的第一个嫌疑犯可能是一个
。您在生成的代码中是否有任何
base
标记?请您为我指出一个方向,以了解th:href=“@{/css/style.css/}”是什么??
<link rel="stylesheet" type="text/css" href="/css/style.css"   th:href="@{ /css/style.css }" />