Font-Awesome icons not rendering via the BoostrapCDN

后端 未结 3 1999
醉酒成梦
醉酒成梦 2021-01-14 02:03

I\'m trying to use Font-Awesome icon fonts via the BootstrapCDN link which I\'m pretty sure I have the latest version of:



        
3条回答
  •  醉酒成梦
    2021-01-14 02:19

    The reason it is not loading is because the URI is starting with "//". That signifies that it is a protocol relative path, meaning it will use whatever protocol that page is using. If you open your html locally, then your browser will use file as the protocol, thus trying to access the font-awesome css with "file://". If you access your html using a local or remote http web server, then you would access the page using the http protocol, thus accessing the css with "http://".

    Solution:

    1. Change the path of the css or mimic it on your local machine.
    2. Run a local or remote http server and access the page.

    For more info: URI starting with two slashes ... how do they behave?

提交回复
热议问题