Unable to load home icon in html code using font-awesome

Issue

<!DOCTYPE html>
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>WEbsite</title>
    
        <link rel="stylesheet" href="css/style.css" />
        <link
          rel="stylesheet"
          href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css"
        />
      </head>
    
      <body>
        <header class="header">
          <nav class="nav-bar">
              <a href="#home"><i class="fa-regular fa-house"></i>  <span>home</span></a>
          </nav>
        </header>
      </body>
    </html>

Unable to load home icon in html code using font-awesome. In place of home icon, browser showing a cross icon. Kindly, tell me what’s wrong with the code?

Solution

Use fa-solid instead of regular.

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>WEbsite</title>

  <link rel="stylesheet" href="css/style.css" />
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.0/css/all.min.css" />
</head>

<body>
  <header class="header">
    <nav class="nav-bar">
      <a href="#home"><i class="fa-solid fa-house"></i>  <span>home</span></a>
    </nav>
  </header>
</body>

</html>

Answered By – カメロン

Answer Checked By – Willingham (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.