How to use Font Awesome in css (content in <hr>)?

问题描述 投票:0回答:0

看起来是这样的:

enter image description here

hr {
  position: relative;
  border: none;
  overflow: visible;
  text-align: center;
  width: 80%;
  top: 3%;
  left: 10%;
  border-top: 3px solid #c7a175;
  border-radius: 2px;
}

hr::after {
  background-color: white;
  content: '\f6ae';
  font: var(--fa-font-solid);
  padding: 0 6px;
  position: relative;
  top: -10px;
}
<head>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>

<body>
  <hr>
</body>

我需要图标才能正常显示
如何解决这个问题?

html css font-awesome
© www.soinside.com 2019 - 2024. All rights reserved.