Github font awesome icon Usage,CSS Class Name,SVG & CSS Content Code

Github font awesome icon css class name is fa-github and CSS Content Code is \f09b.

Github font awesome icon is part of brands icons.

Github font awesome icon usage

We can display Github font awesome icon using 3 different ways depending upon our requirement.

  1. Using CSS Class Name

  2. Using CSS Content Code

  3. Using SVG

Github font awesome icon CSS class name

To display Github font awesome icon, add predefined class name i.e.,fa-github (with prefix fa-) to the i tag.

And we need to add corresponding font awesome icon style for the Github icon.

Github icon has 1 icon style i.e.,brands. We need to append icon style class fab.

<i class='fab fa-github'></i>

Output:

Github font awesome icon CSS Content Code

We can display Github font awesome icon using it’s CSS Content Code \f09b

Use the following HTML code

<li><span class='Github fontawesomeicon'></span>Github</li>

Apply CSS code

<style> 
.fontawesomeicon::before {
    display: inline-block;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
 }

.Github::before {
   font: var(--fa-font-brands);
    content: ' \f09b';
 }</style>

Output:

.fontawesomeicon::before { display: inline-block; text-rendering: auto; -webkit-font-smoothing: antialiased; } .Github::before { font: var(--fa-font-brands); content: ' \f09b'; }
  • Github
  • For the detailed tutorial visit https://www.angularjswiki.com/fontawesome/csscontentcode/

    Github font awesome icon SVG

    Use the following icon SVG to display Github font awesome icon.

    <svg class='fontawesomesvg' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
    
    

    Use the following HTML code

    <p>This <svg class='fontawesomesvg' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><!--! Font Awesome Free 6.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc. --><path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"/></svg>
     Github displayed using SVG</p>
    

    Apply CSS code

    
      <style>
        .fontawesomesvg {width: 1em;
          height: 1em;
          vertical-align: -.125em;
        }
      </style>
    
    

    Output:

    .fontawesomesvg {width: 1em; height: 1em; vertical-align: -.125em; }

    This Github displayed using SVG

    Change Github font awesome icon size

    To increase Github font awesome icon size, use the fa-lg(33 % increase), fa-2x, fa-3x, fa-4x, or fa-5x classes along with icon class \f09b. Increase in icon size will be relative to their parent container.

    <i class='fab fa-github fa-lg'>fa-lg</i><br/>
    <i class='fab fa-github fa-2x'>fa-2x</i><br/>
    <i class='fab fa-github fa-3x'>fa-3x</i><br/>
    <i class='fab fa-github fa-4x'>fa-4x</i><br/>
    <i class='fab fa-github fa-5x'>fa-5x</i><br/>
    
    

    Output:

    fa-lg
    fa-2x
    fa-3x
    fa-4x
    fa-5x

    Github font awesome icon with Fixed Width

    All the font awesome icons does not have same width.

    For example Github icon and home icon may not have same height and width.

    So to display two icons with fixed width and height we can use fa-fw class.

    <i style='border:1px solid;' class='fab fa-github fa-fw fa-3x'></i>Fixed Width<i style='border:1px solid;' class='fab fa-github fa-3x'></i>Normal<br/>
    <i style='border:1px solid;' class='fas fa-home fa-fw fa-3x'></i>Fixed Width<i style='border:1px solid;' class='fas fa-home fa-3x'></i>Normal<br/>
    
    

    Output:

    Fixed WidthNormal
    Fixed WidthNormal

    Github font awesome icon Border

    To add border to Github font awesome icon, use fa-border class.

    <i class='fab fa-github fa-border fa-3x'></i>
    

    Output:

    Pull Github font awesome icon To the left

    To pull Github icon to the left of the container use fa-pull-left class.

    <div style='width: 200px;'>
    <i class='fab fa-github fa-pull-left fa-3x'></i>
      ... The text after Github Icon will be displayed on the right side of the icon.
    </div>
    <div style = 'clear: both;'></div>
    

    Output:

    ... The text after Github Icon will be displayed on the right side of the icon.

    Pull Github font awesome icon To the left

    To pull Github icon to the right of the container use fa-pull-right class.

    <div style='width: 200px;'>
    <i class='fab fa-github fa-pull-right fa-3x'></i>
      ... The text after Github Icon will be displayed on the left side of the icon.
    </div>
    <div style = 'clear: both;'></div>
    

    Output:

    ... The text after Github Icon will be displayed on the left side of the icon.

    Animate Github font awesome icon

    To animate Github font awesome icon, use fa-spin class.

    <i class='fab fa-github fa-spin fa-3x'></i>
    

    Output:

    Animate Github font awesome icon with steps

    While animating the font awesome icon,We can rotate Github icon in 8 steps instead of uniform rotation.

    We can use fa-pulse icon along with fa-spin class.

    <i class='fab fa-github fa-spin fa-pulse fa-3x'></i>
    

    Output:

    Rotate Github font awesome icon

    To rotate Github font awesome icon, Use fa-rotate-x class

    Where ‘x’ represents degree of rotation.

    <div>
    <i class='fab fa-github fa-3x'>R</i>normal<br/><br/>
    <i class='fab fa-github fa-rotate-90 fa-3x'>R</i> fa-rotate-90<br/><br/> 
    <i class='fab fa-github fa-rotate-180  fa-3x'>R</i> fa-rotate-180<br/><br/> 
    <i class='fab fa-github fa-rotate-270 fa-3x'>R</i> fa-rotate-270<br/><br/>
    </div>
    

    Output:

    Rnormal

    R fa-rotate-90

    R fa-rotate-180

    R fa-rotate-270

    Flip Github font awesome icon

    To flip Github font awesome icon horizontally and vertically use fa-flip-horizontal and fa-flip-vertical classes.

    <div>
    <i class='fab fa-github fa-3x'>F</i> Normal <br>
    <i class='fab fa-github fa-flip-horizontal fa-3x'>F</i> fa-flip-horizontal<br>
    <i class='fab fa-github fa-flip-vertical fa-3x'>F</i> fa-flip-vertical<br>
    </div>
    

    Output:

    F Normal
    F fa-flip-horizontal
    F fa-flip-vertical

    Combine Github font awesome icon with other font awesome icons

    In font awesome icons,using stacking we can combine multiple icons and display it as one icon.

    To do that use the fa-stack class on the parent, the fa-stack-1x for the regularly sized icon, and fa-stack-2x for the larger icon.

    And use class fa-inverse for an alternative icon color.

    In the below example, I am displaying Github font awesome icon on top of icons like fa-square,fa-circle and fa-ban.

    And used fa-inverse in the second example to invert the color of the icon.

    <div>
        <span class='fa-stack fa-lg'>
            <i class='far fa-square fa-stack-2x'></i>
            <i class='fab fa-github fa-stack-1x'></i>
        </span>
          Github on fa-square<br>
        <span class='fa-stack fa-lg'>
            <i class='fas fa-circle fa-stack-2x'></i>
            <i class='fab fa-github fa-stack-1x fa-inverse'></i>
        </span>
          Github on fa-circle<br>
    
        <span class='fa-stack fa-lg'>
            <i class='fab fa-github fa-stack-1x'></i>
            <i class='fas fa-ban fa-stack-2x'></i>
        </span>
          Github on fa-ban
    </div>
    

    Output:

    Github on fa-square
    Github on fa-circle
    Github on fa-ban