How to include local file of font awesome 4.1 without using CDN?

后端 未结 6 1119
时光取名叫无心
时光取名叫无心 2020-12-29 05:24

\"With This is the effect with font awesome, i only can get it when i using font awesome 4.1 CDN)

6条回答
  •  自闭症患者
    2020-12-29 05:28

    It is important to ensure relative links to eot & woff files other than css, in case you are using .htaccess

    1) extract downloaded zip file to desired directory

    in case .htaccess path is

    H:\virtualhost\ .htaccess

    and fontawesome css and fonts path is

    H:\virtualhost\fontawesome-free-5.4.2-web\css

    H:\virtualhost\fontawesome-free-5.4.2-web\webfonts

    2) Make following entries in .htaccess

    RewriteRule ^css/([^/]*).css$ /fontawesome-free-5.4.2-web/css/$1.css [L]

    RewriteRule ^webfonts/([^/]*).eot$ /fontawesome-free-5.4.2-web/webfonts/$1.eot [L]

    RewriteRule ^webfonts/([^/]*).woff2$ /fontawesome-free-5.4.2-web/webfonts/$1.woff2 [L]

    RewriteRule ^webfonts/([^/]*).woff$ /fontawesome-free-5.4.2-web/webfonts/$1.woff [L]

    3) Add following in head part of html

    http://local-ip-address:port/css/all.css

提交回复
热议问题