下面的代码可以在Google Chrome测试版和IE7中运行.然而,Firefox似乎在这方面有问题.我怀疑这是一个如何包含CSS文件的问题,因为我知道Firefox对跨域导入不太友好.
但这些都只是静电的超文本标记语言,不存在跨域的问题.
在我的landing-page.html上,我进行了如下CSS导入:
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen, projection" />
在main.css中,我有另一个类似的导入:
@import url("reset.css");
@import url("style.css");
@import url("type.css");
而且在类型内.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; }
我有一个名为"font"的目录,它和type位于同一个位置.css.此字体目录包含所有woff/ttf/svg文件等.
我在这件事上被难住了.It works in Chrome and IE but not on Firefox美元.这怎麽可能?我遗漏了什么?