14
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

WebFont の使い方

Last updated at Posted at 2013-11-05

Usage

WebFont の使い方をざっくりと.

screenshot

Step 01

フォントファイル(.ttf or .otf or .woff) を用意する.
今回は myfont.ttf.

Step 02

CSS3 の @font-face を使って使いたい WebFont を font-family として登録します.
font-family にフォント名, src に読み込むフォントデータへのパスを指定します.

@font-face {
    font-family: 'myfont';
    src: url('myfont.ttf');
}

Step 03

WebFont を使いたい要素に @font-face で登録したフォントを指定します.

body {
    font-family: 'myfont';
}

これで Web Font が使えます.

Example

Demo

Download

Reference

14
14
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?