1. 程式人生 > >CSS引用外部字型的方法

CSS引用外部字型的方法

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS引用外部字型,測試成功</title>
<style>
  @font-face {font-family: DIN_Condensed_Bold;src: url('../font/DIN_Condensed_Bold.ttf');}
  .myfont1{ font-family:DIN_Condensed_Bold;}
  @font-face {font-family: DINPro-Regular;src: url('../font/DINPro-Regular.otf');}
  .myfont2{ font-family:DINPro-Regular;}
  @font-face {font-family: Futurak;src: url('../font/Futurak.ttf');}
  .myfont3{ font-family:Futurak;}
</style>
</head>

<body>
  <h1 class="myfont1">testtesttesttesttesttest</h1>
  <h1 class="myfont2">testtesttesttesttesttest</h1>
  <h1 class="myfont3">testtesttesttesttesttest</h1>
  <h1>testtesttesttesttesttest</h1>
</body>
</html>