早上好HTML视图,晚上好,晚上好,链接CSS使用Thymeleaf
这里一个noob问题,我使用Thymeleaf的模板引擎,并链接引导CSS片似乎并没有工作,这里是我的strucuture
资源
-static
--css
--- bootstrap.min.css
-templates
--view.html
和代码行
< link rel="stylsheet" type="text/css" href="../static/css/bootstrap.min.css" th:href="@{../css/bootstrap.min.css}"/>
编辑:我得到明文.css文件当我打开在href, 连杆和.table-striped
属性我使用我的表类确实存在CSS文件。
<table class="table table-striped">
感谢您的反馈
当你进入开发者工具(F12)时,你有什么错误看到? 我不知道Thymeleaf,但我认为你应该使用../static/css/bootstrap.min.css。 – sniels
嘿,谢谢你的反馈,我没有看到任何错误的开发控制台,我只是通过打开它测试链接,我确实得到明文.css文件..我想这意味着路径是正确的,但我仍然无法在页面上看到CSS的外观和感觉。 – NZED
[IntelliJ Spring Boot项目无法找到带有Thymeleaf的CSS文件](http:// stackoverflow。问题/ 40452365/intellij-spring-boot-project-can-find-my-css-files-with-thymeleaf) – DimaSan