I am currently running a simple spring boot project via vscode. Everything works well but my css and javascript assets won’t load when i run it.
this is my current project structure
and this is how I add the css for instance to the project:
<link rel="stylesheet" th:href="@{/css/mycss.css}"
2
this worked for me
<link rel="stylesheet" th:href="@{css/mycss.css}"/>
To use relative path in html you should use:
<link rel="stylesheet" th:href="@{.assets/css/mycss.css}"
Click here to cancel reply.
2
Answers
this worked for me
To use relative path in html you should use:
<link rel="stylesheet" th:href="@{.assets/css/mycss.css}"