DEV Community

Cover image for How to use Font Awesome in proper way
Hootan
Hootan

Posted on • Edited on

How to use Font Awesome in proper way

First go to cdnjs.com to get the library link.

in code you need one specific class named icon(or whatever) to calling icons and tag class for styling it.

.icon::before{
    display:inline-block;
    font-style:normal;
    font-variant:normal;
    text-rendering: auto;
    -webkit-font-smothing:antialiased;
    font-family: "Font Awesome 6 Free";
    font-weight: 900; 
    /* or it can be 400 */
}
Enter fullscreen mode Exit fullscreen mode

and tag's class for styling
content:"\f061";
color:white;

the \f061
is the icon character

the source site for picking the icon

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay