Making it work in all browsers

If we wanted to make this work in all browsers in the most optimal fashion, we need to provide quite a bit extra. Here's a snippet from the popular blog, CSS Tricks, that describes the ideal @font-face at-rule. (Using @font-face by Chris Coyier of CSS-tricks.com, August 25, 2016, https://css-tricks.com/snippets/css/using-font-face/.)

@font-face {  font-family: 'MyWebFont';  src: url('webfont.eot'); /* IE9 Compat Modes */  src: url('webfont.eot?#iefix') format('embedded-   opentype'), /* IE6-     IE8 */  url('webfont.woff2') format('woff2'), /* Super Modern   Browsers */  url('webfont.woff') format('woff'), /* Pretty Modern     Browsers */  url('webfont.ttf') format('truetype'), /* Safari,   Android, iOS */ url('webfont.svg#svgFontName') ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.