douzha8489 2016-04-15 13:34
浏览 110

如何在Safari中显示Google字体?

I'm developing a site with WordPress and I'm using Google font. In the functions.php file I entered this function:

function load_fonts() {
    wp_register_style('googleFonts', 'https://fonts.googleapis.com/css?family=Playfair+Display:400italic,700italic|Open+Sans:400,400italic,700,700italic,300,300italic');
    wp_enqueue_style( 'googleFonts');
}

add_action('wp_print_styles', 'load_fonts');

In the CSS file I wrote:

.bbpt h3{
    color:#B3D036;
    font-family: 'Playfair Display', serif;
}

This is working fine with Chrome, Mozilla, Opera, Explorer, but not with Safari and iOS devices. I tried to follow the solutions on the web but with no result. How can I solve this problem?

  • 写回答

1条回答 默认 最新

  • douhe5092 2016-04-15 14:02
    关注

    What first comes to mind is to insert the following code into the <head> block of your HTML doc:

    <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Playfair+Display:400italic,700italic|Open+Sans:400,400italic,700,700italic,300,300italic' type='text/css'>
    

    Alternatively, you could copy and paste the text from the file itself into your CSS doc.

    评论

报告相同问题?

悬赏问题

  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能