2017-02-14 150 views
0

我在項目中第一次使用ico moon字體。ico moon字體不顯示

我icomoon css文件:

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

[class^="inf-"], [class*=" inf-"] { 
    /* use !important to prevent issues with browser extensions that change fonts */ 
    font-family: 'icomoon' !important; 
    speak: none; 
    font-style: normal; 
    font-weight: normal; 
    font-variant: normal; 
    text-transform: none; 
    line-height: 1; 


    /* Better Font Rendering =========== */ 
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale; 
} 

.inf-chrome:before { 
    content: "\ead9"; 
} 

.inf-chrome{ text-indent: 0 !important; 
    background-image: none !important; 
    font-size: 16px; 
} 

我使用icomoon字體primeface代碼:

<p:commandButton value="Temps3" icon="inf-chrome" 
              style="height: 25px;width: auto;"/> 

Finaly我ICO月亮字體不顯示,請人給的答案。

回答

0

嘗試添加INF類應該除了類INF鉻所有的圖標是常見的,專用於您的按鈕

<p:commandButton value="Temps3" icon="inf inf-chrome" style="height: 25px;width: auto;"/> 
+0

只是我改變了類名inf-insteadof icon-(默認類),例如,[class^=「icon-」],[class * =「icon-」] ---> [class^=「inf - 「],[class * =」inf-「] –

0

它看起來像你沒有class屬性:

<p:commandButton class="inf-chrome" value="Temps3" icon="inf-chrome" style="height: 25px;width: auto;"/> 

在你的CSS是選擇

[class^="inf-"], [class*=" inf-"] 

這個必要嗎?

.inf-chrome { 
    text-indent: 0 !important; 
    background-image: none !important; 
    font-size: 16px; 
} 

此外,請確保您的icomoon字體已正確加載。

+0

只是我改變了類名inf-而不是icon-(默認類)。 –

+0

例如,[class^=「icon-」],[class * =「icon-」] ---> [class^=「inf-」],[class * =「inf-」] –

+0

Please do you有任何像JSFiddle或類似的在線示例?如果您使用'inf-'而不是'icon-',但是您必須使用與您的CSS選擇器相匹配的CSS類,並確保您的字體路徑是正確的,這沒有任何錯誤。 – quarky