Spring Maven project introduced css, js

1.CSS

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

href attribute is introduced, which starts with writing @} {path and file name: The link tag th

2.JS

<script type="text/javascript" th:src="@{/js/bootstrap.bundle.min.js}"></script>

src = attribute is introduced, which starts with writing @} {path and file name: The script tag th

 

JS and CSS placed under static directory

 

Guess you like

Origin www.cnblogs.com/max-hou/p/11111152.html