how to use font awesome in own css?

后端 未结 4 926
北荒
北荒 2021-02-05 13:04

I\'m using bootstrap and Font Awesome. In a custom css class I\'m working on I tried to include Font Awesome icons instead of using images. Here is my code before Font Awesome.<

4条回答
  •  迷失自我
    2021-02-05 13:38

    you can do so by using the :before or :after pseudo. read more about it here http://astronautweb.co/snippet/font-awesome/

    change your code to this

    .lb-prev:hover {
      filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
      opacity: 1;
       text-decoration: none;
    }
    
    .lb-prev:before {
        font-family: FontAwesome;
        content: "\f053";
        font-size: 30px;
    }
    

    do the same for the other icons. you might want to adjust the color and height of the icons too. anyway here is the fiddle hope this helps

提交回复
热议问题