Search code examples
cssfont-facefont-family

why Gotham font in CSS is not working on firefox?


what i used in css is @font-face like below

   @font-face {
    font-family: 'Gotham';

    src: url('../assets/fonts/Gotham Book.otf')format("opentype");
}

body {
background:transparent;
min-height:100%;    
-webkit-font-smoothing: antialiased;
-webkit-overflow-scrolling: touch;
line-height: 1.5em;
font-size:14px;
font-family: Gotham;
color:#fff;
color:rgba(255,255,255,.8); 
font-weight: normal;

} it works perfectly in chrome but fails in fire fox showing as times new roman . font gotham has been installed in the folder and link is just as given.


Solution

  • I think the solution for this is apply .eot, .woff, .woff2 as you have done

    Please refer below example.

    @font-face {
       font-family: 'co-text';
       src: url('CoText-Light.eot');
       src: url('CoText-Light.eot?#iefix') format('embedded-opentype'),
           url('CoText-Light.woff2') format('woff2'),
           url('CoText-Light.woff') format('woff'),
           url('CoText-Light.ttf') format('truetype');
       font-weight: 300;
       font-style: normal;
    }
    

    Let me know if there is any problem.