@font-face different bold code example

Example 1: @font-face multiple font weights

@font-face {
  font-family: "myFont";
  src: url("myFont-reg.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "myFont";
  src: url("myFont-italic.ttf") format("truetype");
  font-weight: normal;
  font-style: italic;
}

@font-face {
  font-family: "myFont";
  src: url("myFont-bold.ttf") format("truetype");
  font-weight: bold;
  font-style: normal;
}

Example 2: how to apply two static file fonts

@font-face {
    font-family: "DejaVu Sans";
    src: url("./fonts/DejaVuSans.ttf") format("ttf");
}
strong {
    font-family: "DejaVu Sans";
    font-weight: bold;
}

Tags:

Css Example