2016-01-21 80 views
0

我在DOM有select元素,我通過一些CSS對我自己的字體:選擇在Safari中的元素不尊重字體在CSS設置

@font-face { 
     font-family: myFont; 
     src: url('myFont.woff'); 
    } 

    body select{ 
     font-family: myFont; 
    } 

在Chrome中,Firefox和IE瀏覽器的字體看起來精細。但是在Safari v9.0.2中,一旦選擇被點擊,字體就會丟失。

我檢查它使用WhatFont並得到如下:

enter image description here

所以它看起來像這樣- 蘋果系統 - 常規字體已覆蓋我自己。

這是標準的Safari行爲?

我能做些什麼嗎?

+0

可以嘗試'FONT-FAMILY:myFont important'!? – Gintoki

回答

0
try this i hope it will be work. 

<style> 
@font-face { 

font-family: 'BebasNeueRegular'; 

src: url('/wp-content/themes/boilerplate/fonts/BebasNeue-webfont.eot?') format('eot'), 

url('/wp-content/themes/boilerplate/fonts/BebasNeue-webfont.woff') format('woff'), 

url('https://cdn.css-tricks.com/wp-content/themes/boilerplate/fonts/BebasNeue-webfont.ttf') format('truetype'), 

url('/wp-content/themes/boilerplate/fonts/BebasNeue-webfont.svg#webfontfvFLBU0N') format('svg'); 

font-weight: normal; 

font-style: normal; 

} 
</style> 
+0

這是什麼? – Daft