Font-face throw a 404 error for woff files in Chrome

By | November 11, 2013

@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;
}

font face in css

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:


    
      
        
  
Category: CSS

Leave a Reply

Your email address will not be published. Required fields are marked *