How to load external font files in css

青灯夜游
Release: 2021-11-10 16:55:09
Original
8718 people have browsed it

In css, you can use the "@font-face" rule to load external font files, the syntax @font-face {font-family: font name; src: url (external font file path); [font -weight: thickness value];[font-style: style value];}".

How to load external font files in css

The operating environment of this tutorial: windows7 system, CSS3&&HTML5 version, Dell G3 Computer.

In css, you can use the "@font-face" rule to load external font text.

@font-face is A module in CSS3 that mainly embeds user-defined web fonts into your web pages.

By using the @font-face rule, web designers no longer have to use any kind of "network security" Font.

In the @font-face rule, you must first define the font name (for example, myFirstFont) and then point to the font file.

Syntax rules for @font-face:

@font-face {
      font-family: 字体名称;
      src:  [][, []]*;
      [font-weight: ];
      [font-style: