FontAwesome doesn't display in Firefox

前端 未结 6 1971
余生分开走
余生分开走 2020-12-08 07:52

Related question here.

Boris\' answer to the above question seems to make sense, but I installed the Font Awesome files on my server and the problem remains:

6条回答
  •  情话喂你
    2020-12-08 08:52

    solution to make the fontawesome css work locally is to include the files under Fonts folder into the same directory of .html files(pages).

    eg:File structure as of now where fontawesome is not working

        prototype\pages\.html files
        prototype\styles\font-awesome\css\font-awesome.min.css
        prototype\styles\font-awesome\css\fonts\fontawesome-webfont.eot,fontawesome-webfont.woff
    

    The issue here is that for a page loaded from a file:// URI, only files in (or below) the same directory of the filesystem are considered to be "same origin", and so putting the font in a different subtree (../font/) means it will be blocked by security policy restrictions.As Firefox disables cross-domain fonts "by default. Instead change the file structure as below:

          prototype\pages\.html files
          prototype\styles\font-awesome\css\font-awesome.min.css
         prototype\pages\fonts\fontawesome-webfont.eot,fontawesome-webfont.woff
    

    place the fonts folder under pages directory which fixes the issue.Hope it helps.

提交回复
热议问题