1.在页面上方加上
xmlns:th="http://www.thymeleaf.org"
变成这样:
<html lang="en" xmlns:th="http://www.thymeleaf.org">
之后,
CSS和JS这样引入
<link th:href="@{/static/asserts/css/dashboard.css}" rel="stylesheet">
<script type="text/javascript" th:src="@{/static/asserts/js/jquery-3.2.1.slim.min.js}"></script>
目录结构:

本文介绍如何在HTML文件中使用Thymeleaf模板引擎,包括如何正确引入Thymeleaf命名空间、CSS和JS资源文件。通过实例展示了Thymeleaf的基本用法和页面结构,适合初学者快速上手。
926

被折叠的 条评论
为什么被折叠?



