Using icon font with Font Awesome 5

HTML Code:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Font Awesome</title>
  <!-- using font awesome -->
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <!-- importing css -->
  <link rel="stylesheet" href="css/main.css">
</head>
<body>
  <div class="container">
    <i class="fas fa-user"></i>
    <i class="fas fa-chevron-right"></i>
    <i class="fas fa-spinner"></i>

    <span class="user"></span>
    <span class="spinner"></span>
  </div>
</body>
</html>

CSS Code:
.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 15px;
}

.fas {
  font-size: 40px;
  color: green;
}

.user:before {
  content: '\f007';
  font-family: "Font Awesome 5 Free"; 
  font-weight: 900;
  font-size: 60px;
  color: red;
}

.spinner:before {
  content: '\f110';
  font-family: "Font Awesome 5 Free"; 
  font-weight: 900;
  font-size: 60px;
  color: blue;
}

Video Tutorial

Share this

Related Posts