Answers for "ttf font in css"

CSS
1

use .ttf in css

@font-face {
  font-family:"Name-Of-Font";
  src: url("yourfont.ttf") format("truetype");
}
Posted by: Guest on January-05-2021
1

css import font ttf

@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  */
  }

@font-face {
    font-family: 'MyWebFont';
    src: url('myfont.woff2') format('woff2'),
         url('myfont.woff') format('woff'),
         url('myfont.ttf') format('truetype');
  }  

  body {
    font-family: 'MyWebFont', Fallback, sans-serif;
  }
Posted by: Guest on July-02-2021
25

css font face

@font-face {
  // Defining what the font will be called
  font-family: thisSpecialFont;
  // Linking to the font file
  src: url(linkToFontFile.woff);
}
body {
  font-family: thisSpecialFont;
}
Posted by: Guest on October-29-2020

Browse Popular Code Answers by Language