java - FontAwesome 没有显示在 Thymeleaf 中?

标签 java thymeleaf

下面的示例仅显示了一些类似十六进制的占位符,而不是正确的图标。使用 spring-bootthymeleaf 可能会出现什么问题?

<html>
  <head>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/fontawesome.min.css" rel="stylesheet" type="text/css" />
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/regular.min.css" rel="stylesheet" type="text/css" />

  </head>

  <body>
        <i class="fa fa-car"></i>
        <i class="fa fa-car" style="font-size:48px;"></i>
        <i class="fa fa-car" style="font-size:60px;color:red;"></i>
  </body>
</html>

最佳答案

包含样式表 all.css

 <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.11.2/css/all.css" rel="stylesheet" type="text/css" />

关于java - FontAwesome 没有显示在 Thymeleaf 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58170774/

相关文章:

java - 我应该使用什么布局来获得我想要的 GUI?

java - 应用程序使用的内存大于实际堆转储大小

spring - thymeleaf - 将选择变量表达式 *{foo} 传递给表达式实用程序对象

Thymeleaf - 手动处理模板和国际化?

javascript - 下拉列表更改时更改表内容

java - 对 Jtable 中的行进行排序时出错

java - 将文本框的标签放置在文本框上方而不是侧面

java - 如何使用流将二维 int 数组转换为单个字符串?

spring-mvc - Thymeleaf: <label> 将动态文本与静态文本 Spring MVC 连接起来

hibernate - org.springframework.expression.spel.SpelEvaluationException : EL1007E: Property or field 'chargesName' cannot be found on null