gpt4 book ai didi

html - @font-face 在 IE7 和 IE8 中不工作

转载 作者:行者123 更新时间:2023-11-28 12:47:22 25 4
gpt4 key购买 nike

我正在尝试自定义字体并利用了我所知道的一切(包括 ?#iefix),它在除 IE8 和 IE7 之外的所有浏览器上都运行良好。我将其简化为最基本的结构,但仍然能看到问题。

Here's a link to the live version of the test

这是 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>

这里的 CSS:

@charset "utf-8";
/* CSS Document */

@font-face {
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;
}

h1 {
font-family: 'swz721kc';
font-size: 42px;
color: #000;
font-weight: normal;
margin: 30px 0 0 0;
padding: 0;
}

最佳答案

试试这个:

@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');
}

这是我用来嵌入字体并让它们跨浏览器工作的格式。

关于html - @font-face 在 IE7 和 IE8 中不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17266265/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com