devwiki:html

This is an old revision of the document!


Use custom Font in web

  • convert tff font to webfont:
  • define font face in css 1st line
    @font-face {
        font-family: 'theFontNameHere';
        src: url('theFontNameHere-webfont.woff2') format('woff2'),
             url('theFontNameHere-webfont.woff') format('woff');
        font-weight: normal;
        font-style: normal;
     
    }
    body.CN{
            font-family: 'theFontNameHere';
    }
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
</body>
</html>

Problem and Solution

css file not loading

  • problem: some css file loaded while some not
  • solution: make sure no number in theCSSName.css
  • devwiki/html.1630053517.txt.gz
  • Last modified: 2021/08/27 08:38
  • by ying