【问题标题】:CSS + Thyemleaf - CSS not reflecting on the pageCSS + Thymeleaf - CSS 不反映在页面上
【发布时间】:2019-02-16 06:07:18
【问题描述】:

我的 Spring Boot 应用程序中的 CSS 有问题。

我有以下项目结构。

  • src/resources/static/(用于 css 文件)
  • src/resources/templates/(用于 html 文件)

在我的 html 页面中,我正在使用以下内容。

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

这不起作用。我在这里遗漏了什么吗?

任何帮助将不胜感激。

谢谢!

【问题讨论】:

    标签: spring css spring-boot thymeleaf


    【解决方案1】:

    只需使用th:href="@{/site.css}"

    【讨论】:

    • 谢谢!拯救了我的一天。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多