案例:CSS3案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<style> 
5
@font-face
6
{
7
font-family: myFirstFont;
8
src: url('/example/css3/Sansation_Light.ttf')
9
    ,url('/example/css3/Sansation_Light.eot'); /* IE9+ */
10
}
11
12
@font-face
13
{
14
font-family: myFirstFontBold;
15
src: url('/example/css3/Sansation_Bold.ttf')
16
    ,url('/example/css3/Sansation_Bold.eot'); /* IE9+ */
17
font-weight:bold;
18
}
19
20
div
21
{
22
font-family:myFirstFont;
23
}
24
span
25
{
26
font-family:myFirstFontBold;
27
}
28
</style>
29
</head>
30
<body>
31
32
<div>
33
With CSS3, websites can <span>finally</span> use fonts other than the pre-selected "web-safe" fonts.
34
</div>
35
36
<p><b>注释:</b>Internet Explorer 9+ 支持新的 @font-face 规则。Internet Explorer 8 以及更早的版本不支持新的 @font-face 规则。</p>
37
38
</body>
39
</html>