How to Add Customized Fonts to A Webpage

陆绪
2023-12-01

1. go to https://www.fontsquirrel.com/ and download a font that you like.

2. use https://www.fontsquirrel.com/tools/webfont-generator to convert the font file to woff or woff2.

3. create a css file that include the following content(this is an example, change it to suit your needs):

@font-face {
    font-family: 'alex_brushregular';
    src: url('alexbrush-regular-webfont.woff2') format('woff2'),
         url('alexbrush-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;

}

4. create a link to the css file above in your HTML file.

5. now you can use this font-family in your other CSS files to apply this fonts to any CSS elements.

6. Done.

 类似资料:

相关阅读

相关文章

相关问答