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
  • 11,060
  • 15
  • 46
  • 72
frazras
  • 5,928
  • 4
  • 30
  • 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
  • 12
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,951
  • 6
  • 29
  • 36