Search code examples
cssimagegithubcss-contentocticons

CSS image content: '\f035';


I was just looking through the source of github.com's page and I saw them use some code for their add to clipboard button icon

.octicon-clippy:before {
      content: '\f035';
}

How can this create an icon without a path to an image?


Solution

  • I'm not sure if you are familiar with font-awesome, but it too uses unicode characters to create icons. Check this out.

    After you save the font-awesome stylesheets...etc. to your project you can insert an image icon as simple as:

    <i class="fa fa-camera-retro"></i>
    

    EDIT

    You mentioned a clipboard icon, well here is how simple it would be with font-awesome:

    <i class="fa fa-clipboard"></i>
    

    source