以下代码适用于Google Chrome测试版以及IE 7.但是,Firefox似乎存在此问题.我怀疑它是如何包含我的CSS文件的问题,因为我知道Firefox对跨域导入不太友好.
但这只是静态HTML而且不存在跨域问题.
在我的landing-page.html上,我像这样进行CSS导入:
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, projection" />
Run Code Online (Sandbox Code Playgroud)
在main.css中我有另外一个这样的导入:
@import url("reset.css");
@import url("style.css");
@import url("type.css");
Run Code Online (Sandbox Code Playgroud)
在type.css中我有以下声明:
@font-face {
font-family: "DroidSerif Regular";
src: url("font/droidserif-regular-webfont.eot");
src: local("DroidSerif Regular"),
url("font/droidserif-regular-webfont.woff") format("woff"),
url("font/droidserif-regular-webfont.ttf") format("truetype"),
url("font/droidserif-regular-webfont.svg#webfontpB9xBi8Q") format("svg");
font-weight: normal; font-style: normal; }
@font-face {
font-family: "DroidSerif Bold";
src: url("font/droidserif-bold-webfont.eot");
src: local("DroidSerif Bold"),
url("font/droidserif-bold-webfont.woff") format("woff"),
url("font/droidserif-bold-webfont.ttf") format("truetype"),
url("font/droidserif-bold-webfont.svg#webfontpB9xBi8Q") format("svg");
font-weight: normal; font-style: normal; }
body { font-family: "DroidSerif Regular", serif; }
h1 { font-weight: bold; font-family: "DroidSerif Bold", serif; }
Run Code Online (Sandbox Code Playgroud)
我在type.css的相同位置有一个名为"font"的目录.这个字体目录包含所有woff/ttf/svg文件等.
我很难过这个. …