Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在WordPress中设置internet explorer的字体?_Php_Css_Wordpress_Internet Explorer_Fonts - Fatal编程技术网

Php 如何在WordPress中设置internet explorer的字体?

Php 如何在WordPress中设置internet explorer的字体?,php,css,wordpress,internet-explorer,fonts,Php,Css,Wordpress,Internet Explorer,Fonts,我只在WordPress中为internet explorer设置字体 所有字体都位于子主题的根目录中 这是ie-only.css中的代码 @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { @font-face { font-family: 'open_sansregular'; src: url('opensans-regular-webfont.eot');

我只在WordPress中为internet explorer设置字体

所有字体都位于子主题的根目录中

这是ie-only.css中的代码

    @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { 

    @font-face {
    font-family: 'open_sansregular';
    src: url('opensans-regular-webfont.eot');
    src: url('opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
         url('opensans-regular-webfont.woff2') format('woff2'),
         url('opensans-regular-webfont.woff') format('woff'),
         url('opensans-regular-webfont.ttf') format('truetype'),
         url('opensans-regular-webfont.svg#open_sansregular') format('svg');
    font-weight: normal;
    font-style: normal;

    }


    .text-highlight { border: 1px solid red; font-family:open_sansregular;  }

}
您知道在子主题的根目录中查找字体系列的正确地址吗


感谢您的帮助。谢谢

我能够解决我的问题

要在Internet explorer中启用字体,请为IE创建单独的css。 例如:

<link rel="stylesheet" type="text/css" href="<?php echo get_stylesheet_directory_uri(); ?>/ie-only.css" />
上面声明的所有字体文件都应该在您使用的目录中可用


谢谢。

我认为您没有正确设置字体路径。请尝试此代码

@font-face {
font-family: 'open_sansregular';
src: url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.eot');
src: url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.woff2') format('woff2'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.woff') format('woff'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.ttf') format('truetype'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.svg#open_sansregular') format('svg');
font-weight: normal;
font-style: normal;

}
@font-face{
字体系列:“open_sansregular”;
src:url('/font/opensans regular-webfont.eot');
src:url('/font/opensans regular webfont.eot?#iefix')格式('embedded-opentype'),
url('/fonts/opensans常规webfont.woff2')格式('woff2'),
url('/fonts/opensans常规webfont.woff')格式('woff'),
url('/fonts/opensans常规webfont.ttf')格式('truetype'),
url('/fonts/opensans regular webfont.svg#open#sansregular')格式('svg');
字体大小:正常;
字体风格:普通;
}

此字体opensans-regular-webfont.eot及其类似产品的安装位置在哪里?哪个目录?嗨,Shoeb,opensans-regular-webfont.eot在子目录中,请检查它的源代码,然后只有我可以评论。。
@font-face {
font-family: 'open_sansregular';
src: url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.eot');
src: url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.eot?#iefix') format('embedded-opentype'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.woff2') format('woff2'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.woff') format('woff'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.ttf') format('truetype'),
     url('<?php echo get_stylesheet_directory_uri(); ?>/fonts/opensans-regular-webfont.svg#open_sansregular') format('svg');
font-weight: normal;
font-style: normal;

}