Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/34.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
Html @字体在IE7和IE8中不起作用_Html_Css_Internet Explorer 8_Internet Explorer 7_Font Face - Fatal编程技术网

Html @字体在IE7和IE8中不起作用

Html @字体在IE7和IE8中不起作用,html,css,internet-explorer-8,internet-explorer-7,font-face,Html,Css,Internet Explorer 8,Internet Explorer 7,Font Face,我正在尝试一种自定义字体,并利用了我所知道的一切(包括?#iefix),它在除IE8和IE7之外的所有浏览器上都工作得很好。我把它简化成了简单的框架,但仍然看到了这个问题 这是HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.

我正在尝试一种自定义字体,并利用了我所知道的一切(包括?#iefix),它在除IE8和IE7之外的所有浏览器上都工作得很好。我把它简化成了简单的框架,但仍然看到了这个问题

这是HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="styles.css">
</head>

<body>
<h1>This is a test.</h1>
</body>
</html>
试试这个:

@font-face {
  font-family: 'swz721kc';
  font-style: normal;
  font-weight: 400;
  src: url(/compass-learning/test/fonts/swz721kc.eot);
  src: local('swz721kc'),
    url(/compass-learning/test/fonts/swz721kc.ttf) format('truetype');
}
这是我用来嵌入字体并使其在浏览器间工作的格式。

试试这个:

@字体{

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


“/”添加在“字体”之前。

@cathius-您是否确保在IE浏览器环境中按下重新加载按钮,以便重新加载样式表?
font-family: 'swz721kc';
src: url('/fonts/swz721kc.eot');
src: url('/fonts/swz721kc.eot?#iefix') format('embedded-opentype'),
     url('/fonts/swz721kc.woff') format('woff'),
     url('/fonts/swz721kc.ttf') format('truetype'),
     url('/fonts/swz721kc.svg#swz721kc') format('svg');
font-weight: normal;
font-style: normal;