2016-01-21 78 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