@font-face css rule use for stylish custom font instead of have to use one of the “web-safe” fonts.
@font-face { font-family: myCustomFont; 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 */ }
Now the myCustomFont is ready to use with any class, id or element of website, below is an example of how to use it for all div elements:
div { font-family: myCustomFont; }
Problem : @font-face rule throw 404 error for woff type file in Chrome And Mozila Browser with IIS server.
Solution :
add the MIME types in the web config: