开发者

why isn't this font embed working?

开发者 https://www.devze.com 2023-03-01 08:58 出处:网络
<!DOCTYPE HTML> <HEAD> <style type=\"text/css\"> @font-face { font-family: Blah; src: url(\'../fonts/WillyWonka.ttf\');
   <!DOCTYPE HTML>

<HEAD>
<style type="text/css">

@font-face { font-family: Blah; src: url('../fonts/WillyWonka.ttf'); 

} 

span.header {
font-family: 'palatino linotype', palatino, serif;
font-size: 36px;
font-weight: bold;
font-variant: small-caps;
color: white;
text-decoration:none;
padding: 20pt;
}

span.content {
font-family: 'Blah', arial, serif;
font-size: 36pt;
}




#contacttable {
position:absolute;
left:20%;top:15px;
}

#contacttable td {
position:absolute;
}

</style>

</HEAD>

<BODY bgcolor="black">
<Table id="contacttable">
<tr>
<td>
<span class="header"> Title of Section </span>
<hr />
<br><br><br>
<span class="content"><font color="red">l</font><font 

color="orange">o</font><font color="yellow">w</font>

...

for some reason changing th开发者_如何学Ce font has made it not work. any help? (source http://theriverbendstreetbeach.org/nads/misc/showyou.html )


Remember that CSS url paths are relative to the CSS file (or in this case the html that declares the CSS).

By saying url(../fonts/WillyWonka.ttf) your are instructing the browser to look one directory up from the HTML, and then down into the fonts folder:

http://theriverbendstreetbeach.org/nads/fonts/WillyWonka.ttf

And it would seem your font file is actually located at:

http://theriverbendstreetbeach.org/fonts/WillyWonka.ttf

So for this particular HTML file, I would change the url path to url(../../fonts/WillyWonka.ttf);


As posted by Shad in comments, your font is missing from http://theriverbendstreetbeach.org/nads/fonts/WillyWonka.ttf.

You can easily debug these kinds of problems yourself by using a tool such as Fiddler: http://www.fiddler2.com/fiddler2/

It is a proxy that shows you all of the requests, and their status codes. 404s show up in nice red.

0

精彩评论

暂无评论...
验证码 换一张
取 消