Skip to content

Instantly share code, notes, and snippets.

@trumball
Created May 24, 2013 13:31
Show Gist options
  • Save trumball/5643516 to your computer and use it in GitHub Desktop.
Save trumball/5643516 to your computer and use it in GitHub Desktop.
@font-face Template Here is another bit of CSS3 code which isn’t the easiest to memorize. Using @font-face you may embed your own TTF/OTF/SVG/WOFF files into your website and generate custom font families. Use this template as a base example for your own projects in the future.
@font-face {
font-family: 'MyWebFont';
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff') format('woff'), /* Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
body {
font-family: 'MyWebFont', Arial, sans-serif;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment