简体   繁体   English

百里香叶无法达到链接th:src路线

[英]Can't reach link th:src route on thymeleaf

Well, that's nothing more, tried everything, googled and still unsolving this tricky problem, 好吧,仅此而已,尝试了一切,谷歌搜索并仍然解决了这个棘手的问题,

I'll be glad if you can help me with this! 如果您能帮助我,我将很高兴!

Here you can see how it looks; 在这里,您可以看到它的外观; 在此处输入图片说明

Here is the css code; 这是css代码;

<link rel="stylesheet" src="/static/assets/css/style.css"
th:href="@{/assets/css/style.css}" media="screen" type="text/css"></link>

And here you can see the organization of my files. 在这里您可以看到我文件的组织。

在此处输入图片说明

In your html code start with this 在您的html代码中以此开头

<html xmlns:th="http://www.thymeleaf.org">

In addition , delete the src from the link and replace it with href 此外,从链接中删除src并将其替换为href

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

Do this. 做这个。 Pay attention to the '..' and rel="stylesheet" 注意“ ..”和rel =“ stylesheet”

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM