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

Git font awesome icon css class name is fa-git and CSS Content Code is \f1d3.

Git font awesome icon is part of brands icons.

Git font awesome icon usage

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

  1. Using CSS Class Name

  2. Using CSS Content Code

  3. Using SVG

Git font awesome icon CSS class name

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

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

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

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

Output:

Git font awesome icon CSS Content Code

We can display Git font awesome icon using it’s CSS Content Code \f1d3

Use the following HTML code

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

Apply CSS code

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

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

Output:

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

    Git font awesome icon SVG

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

    <svg class='fontawesomesvg' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 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="M216.29 158.39H137C97 147.9 6.51 150.63 6.51 233.18c0 30.09 15 51.23 35 61-25.1 23-37 33.85-37 49.21 0 11 4.47 21.14 17.89 26.81C8.13 383.61 0 393.35 0 411.65c0 32.11 28.05 50.82 101.63 50.82 70.75 0 111.79-26.42 111.79-73.18 0-58.66-45.16-56.5-151.63-63l13.43-21.55c27.27 7.58 118.7 10 118.7-67.89 0-18.7-7.73-31.71-15-41.07l37.41-2.84zm-63.42 241.9c0 32.06-104.89 32.1-104.89 2.43 0-8.14 5.27-15 10.57-21.54 77.71 5.3 94.32 3.37 94.32 19.11zm-50.81-134.58c-52.8 0-50.46-71.16 1.2-71.16 49.54 0 50.82 71.16-1.2 71.16zm133.3 100.51v-32.1c26.75-3.66 27.24-2 27.24-11V203.61c0-8.5-2.05-7.38-27.24-16.26l4.47-32.92H324v168.71c0 6.51.4 7.32 6.51 8.14l20.73 2.84v32.1zm52.45-244.31c-23.17 0-36.59-13.43-36.59-36.61s13.42-35.77 36.59-35.77c23.58 0 37 12.62 37 35.77s-13.42 36.61-37 36.61zM512 350.46c-17.49 8.53-43.1 16.26-66.28 16.26-48.38 0-66.67-19.5-66.67-65.46V194.75c0-5.42 1.05-4.06-31.71-4.06V154.5c35.78-4.07 50-22 54.47-66.27h38.63c0 65.83-1.34 61.81 3.26 61.81H501v40.65h-60.56v97.15c0 6.92-4.92 51.41 60.57 26.84z"/></svg>
    
    

    Use the following HTML code

    <p>This <svg class='fontawesomesvg' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 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="M216.29 158.39H137C97 147.9 6.51 150.63 6.51 233.18c0 30.09 15 51.23 35 61-25.1 23-37 33.85-37 49.21 0 11 4.47 21.14 17.89 26.81C8.13 383.61 0 393.35 0 411.65c0 32.11 28.05 50.82 101.63 50.82 70.75 0 111.79-26.42 111.79-73.18 0-58.66-45.16-56.5-151.63-63l13.43-21.55c27.27 7.58 118.7 10 118.7-67.89 0-18.7-7.73-31.71-15-41.07l37.41-2.84zm-63.42 241.9c0 32.06-104.89 32.1-104.89 2.43 0-8.14 5.27-15 10.57-21.54 77.71 5.3 94.32 3.37 94.32 19.11zm-50.81-134.58c-52.8 0-50.46-71.16 1.2-71.16 49.54 0 50.82 71.16-1.2 71.16zm133.3 100.51v-32.1c26.75-3.66 27.24-2 27.24-11V203.61c0-8.5-2.05-7.38-27.24-16.26l4.47-32.92H324v168.71c0 6.51.4 7.32 6.51 8.14l20.73 2.84v32.1zm52.45-244.31c-23.17 0-36.59-13.43-36.59-36.61s13.42-35.77 36.59-35.77c23.58 0 37 12.62 37 35.77s-13.42 36.61-37 36.61zM512 350.46c-17.49 8.53-43.1 16.26-66.28 16.26-48.38 0-66.67-19.5-66.67-65.46V194.75c0-5.42 1.05-4.06-31.71-4.06V154.5c35.78-4.07 50-22 54.47-66.27h38.63c0 65.83-1.34 61.81 3.26 61.81H501v40.65h-60.56v97.15c0 6.92-4.92 51.41 60.57 26.84z"/></svg>
     Git 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 Git displayed using SVG

    Change Git font awesome icon size

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

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

    Output:

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

    Git font awesome icon with Fixed Width

    All the font awesome icons does not have same width.

    For example Git 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-git fa-fw fa-3x'></i>Fixed Width<i style='border:1px solid;' class='fab fa-git 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

    Git font awesome icon Border

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

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

    Output:

    Pull Git font awesome icon To the left

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

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

    Output:

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

    Pull Git font awesome icon To the left

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

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

    Output:

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

    Animate Git font awesome icon

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

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

    Output:

    Animate Git font awesome icon with steps

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

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

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

    Output:

    Rotate Git font awesome icon

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

    Where ‘x’ represents degree of rotation.

    <div>
    <i class='fab fa-git fa-3x'>R</i>normal<br/><br/>
    <i class='fab fa-git fa-rotate-90 fa-3x'>R</i> fa-rotate-90<br/><br/> 
    <i class='fab fa-git fa-rotate-180  fa-3x'>R</i> fa-rotate-180<br/><br/> 
    <i class='fab fa-git 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 Git font awesome icon

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

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

    Output:

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

    Combine Git 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 Git 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-git fa-stack-1x'></i>
        </span>
          Git on fa-square<br>
        <span class='fa-stack fa-lg'>
            <i class='fas fa-circle fa-stack-2x'></i>
            <i class='fab fa-git fa-stack-1x fa-inverse'></i>
        </span>
          Git on fa-circle<br>
    
        <span class='fa-stack fa-lg'>
            <i class='fab fa-git fa-stack-1x'></i>
            <i class='fas fa-ban fa-stack-2x'></i>
        </span>
          Git on fa-ban
    </div>
    

    Output:

    Git on fa-square
    Git on fa-circle
    Git on fa-ban