2

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?

James A Mohler
  • 10,884
  • 14
  • 43
  • 67
frazras
  • 5,091
  • 3
  • 28
  • 40

2 Answers2

1

f035 is an escape sequence and is rendered as a single character. My guess is they use icon font technique.

Community
  • 1
  • 1
Paul Kozlovitch
  • 786
  • 7
  • 11
1

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

Travis Clarke
  • 5,065
  • 5
  • 27
  • 36