how to use custom fonts and icons in codeigniter

2020-05-07 02:15发布

问题:

Slam everyone i want to use custom icons from flaticon.com inside my view the icons in http://successpermis.com/css/flaticon.html as html it is working fine , but when i use it inside the view it is not working i think the problem in loading the font

    @font-face {
    font-family: "Flaticon";
    src: url("http://successpermis.com/css/flaticon.eot");
    src: url("http://successpermis.com/css/flaticon.eot#iefix") format("embedded-opentype"),
    url("http://successpermis.com/css/flaticon.woff") format("woff"),
    url("http://successpermis.com/css/flaticon.ttf") format("truetype"),
    url("http://successpermis.com/css/flaticon.svg") format("svg");
    font-weight: normal;
    font-style: normal;
}

i tried to load fonts from local folders then from online host just like the code above can you tell me to do it in a right way

回答1:

folder structure

- application
- assets
    - css 
    - js
    - images
    - fonts

style.css

  @font-face {
        font-family: "Flaticon";
        src: url("assets/fonts/flaticon.eot");

        -------------
    }