Font awesome inside asp button

前端 未结 7 2078
别那么骄傲
别那么骄傲 2020-12-01 05:56

This is my asp:button code which is not rendering font awesome\'s icon but instead shows the HTML as it is:

  

        
7条回答
  •  青春惊慌失措
    2020-12-01 06:40

    You can do it, jut not purely with CSS. You just need to set the Text property on the button to the unicode value of the fontawesome character and give the button the 'fa' css class so it takes up the fontawesome font.

    
    

    I made this helper library that provides all the icon codes strongly-typed if that turns your crank:

    
    

    Nuget: Install-Package FontAwesome-ASP.NET

    Source: https://github.com/kemmis/FontAwesome-ASP.NET

提交回复
热议问题