How to add some non-standard font to a website?

后端 未结 19 1366
时光说笑
时光说笑 2020-11-22 02:17

Is there a way to add some custom font on a website without using images, Flash or some other graphics?

For example, I was working on a wedding website, and I found

相关标签:
19条回答
  • 2020-11-22 03:07

    This could be done via CSS:

    <style type="text/css">
    @font-face {
        font-family: "My Custom Font";
        src: url(http://www.example.org/mycustomfont.ttf) format("truetype");
    }
    p.customfont { 
        font-family: "My Custom Font", Verdana, Tahoma;
    }
    </style>
    <p class="customfont">Hello world!</p>
    

    It is supported for all of the regular browsers if you use TrueType-Fonts (TTF), the Web Open Font Format (WOFF) or Embedded Opentype (EOT).

    0 讨论(0)
提交回复
热议问题