How to install a Font in server

前端 未结 6 1457
清歌不尽
清歌不尽 2021-01-04 06:42

I have downloaded and installed a font in my system, then i used this font in my project, its worked fine in local system, but when i upload this page to server its not work

6条回答
  •  春和景丽
    2021-01-04 07:07

    First you need to upload your font file to server, download zip file of your font and upload the unziped folder to server via FTP like filezilla then you may use this in you css but replace "font/path" with your path where you are going to upload the font and its not compulsory to upload all extension file given below but it is a good practice to do so if you don't want to upload any extension file just remove its entry from below code

    @font-face { font-family: 'Font Name'; src: url('font/path/fontname.eot'); src: url('font/path/fontname.eot?#iefix') format('embedded-opentype'), url('font/path/fontname.woff') format('woff'), url('font/path/fontname.ttf') format('truetype'); font-weight: normal; font-style: normal;}
    

    You can use it like

    #element { font-family: 'Font Name'; }
    

    Hope this helps

提交回复
热议问题