CSS Import Fonts

后端 未结 2 1898
青春惊慌失措
青春惊慌失措 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 */
    }
    

提交回复
热议问题