How/where to install font Awesome in jquery mobile app

て烟熏妆下的殇ゞ 提交于 2019-12-08 08:30:06

问题


Try as I might I can't get Font Awesome working at all. I've uploaded the Font Awesome pack to my root directory and linked to it.

<link rel="stylesheet" type="text/css" href="font-awesome/jqm-icon-pack-fa.css">

The css includes the font declaration

@font-face {
font-family: 'FontAwesome';
src: url('font/fontawesome-webfont.eot');
src: url('font/fontawesome-webfont.eot?#iefix') format('embedded-opentype'),
     url('font/fontawesome-webfont.woff') format('woff'),
     url('font/fontawesome-webfont.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}

The fonts reside in the child directory root/font-awesome/font/

My link markup example:

<a href="#info"  data-rel="popup" data-mini="true"data-iconpos="notext" data-transition="slideup"data-role="button" ><i class="icon-cog"></i></a>

Doesn't seem to matter what icon tag I place - I get a blank circle.

Any suggestions would be appreciable. This happens in Firefox safari on my mac and safari on iOS 6.0 - iPhone


回答1:


I've tested this on both Font Awesome 4 and earlier versions. My answer below is based on version 4.

So what you need to do is copy your icon classes from the Font Awesome style sheet and add them to your own style sheet. Then just add ui-icon- in front of the class name. You must also do this to the class where the font-family is created.

For example if you have data-icon="fa fa-cog"

The font-family class is .fa and this will become .ui-icon-fa

.ui-icon-fa {}

And the actual icon css .fa-cog will become .ui-icon-fa-cog

.ui-icon-fa-cog:before {
 content: "\f013";
}

Hope this makes sense.




回答2:


Does the Font Awesome website examples work in these browsers?

Make sure your HTML doctype is HTML5: <!DOCTYPE html>



来源:https://stackoverflow.com/questions/18809890/how-where-to-install-font-awesome-in-jquery-mobile-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!