FontAwesome没有在Thymeleaf中显示?

时间:2019-09-30 15:16:35

标签: 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>

1 个答案:

答案 0 :(得分:1)

包括样式表all.css

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