使用Thymeleaf将CSS链接到HTML视图

纽西兰币

早上好,晚上好,晚上好,

这里有一个菜鸟问题,我使用Thymeleaf作为模板引擎,并且链接Bootstrap CSS工作表似乎不起作用,这是我的结构

资源
-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}"/>

编辑:当我在href中打开链接时,确实得到了纯文本.css文件,并且.table-striped我在表类中使用属性确实存在于CSS文件中。

<table class="table table-striped">

感谢您的反馈意见

纽西兰币

终于明白了..那是URL,这对我有用,默认情况下处理/ static,我想因此将其从URL及其“ twerkin”中删除。

结构
-static
--css
--- bootstrap.min.css
-templates
--view.html

CSS链接
th:href =“ @ {/ css / bootstrap.min.css}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章