告诉我,为什么我的浏览器看不到我的 css 文件? 我使用 spring boot 和 thymeleaf :
<link rel="stylesheet" type="text/css" href="../static/css/style.css" th:href="@{/css/style.css}"/>
我的 css 文件在 resources/static/css 我的模板在资源/模板上
当我在 InteliJ 中单击“chrome”图标时,一切都在离线状态下正常工作,但是当我运行我的应用程序时,没有加载 css。
最佳答案
你不需要设置href="../static/css/style.css"
尝试:
<link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
关于html - Thymeleaf - Chrome 看不到 css 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47521412/