CSS Import Fonts

后端 未结 2 1886
青春惊慌失措
青春惊慌失措 2021-01-12 10:17

I have 4 Fonts I need to use on a website and i have there files in my website folder

Baskerville.ttc
BellGothicstd-Black.otf
BellGothicstd-Bold.otf
JennaSu         


        
相关标签:
2条回答
  • 2021-01-12 11:02

    You will need to convert the font into the correct formats for all browsers to display them.. (check rights before you do this)

    http://www.fontsquirrel.com/tools/webfont-generator

    Your @font-face rule will also need to include all the font types...

    Example:

    @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') format('svg'); /* Legacy iOS */
    }
    
    0 讨论(0)
  • 2021-01-12 11:07

    U need to generate font-faceto all the fonts for OS and Browser compatibility.

    Font-face generator URL:http://www.fontsquirrel.com/tools/webfont-generator

    @font-face {
     font-family: 'Helvetica';
    src: url('helvetica.eot');
    src: url('helvetica.eot?iefix') format('eot'),
     url('helvetica.woff') format('woff'),
     url('helvetica.ttf') format('truetype'),
     url('helvetica.svg#helvetica') format('svg');
    font-weight: normal;
    font-style: normal;
     }
    
    0 讨论(0)
提交回复
热议问题