reirab
0
Q:

css import font

@font-face {
  font-family: "Open Sans";
  src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
       url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}
2
<!-- Add this in your <head> tag -->
<link
      rel="stylesheet"
      href="https://use.fontawesome.com/releases/v5.13.0/css/all.css"
      integrity="sha384-Bfad6CLCknfcloXFOyFnlgtENryhrpZCe29RTifKEixXQZ38WheV+i/6YWSzkz3V"
      crossorigin="anonymous"
    />
1

@font-face {
  font-family: myFirstFont;
  src: url(sansation_bold.woff);
  font-weight: bold;
}
 
3
@font-face {
  font-family: myFirstFont;
  src: url(sansation_light.woff);
}

div {
  font-family: myFirstFont;
}
/*Name the font-family and link the font file in the @font-face rule*/
10
/* Answer to: "add font to css" */

/*
  In the @font-face rule; first define a name for the font 
  (e.g. myFirstFont) and then point to the font file.

  Tip: Always use lowercase letters for the font URL. Uppercase
  letters can give unexpected results in IE.

  To use the font for an HTML element, refer to the name of the
  font (myFirstFont) through the font-family property:
*/

@font-face {
  font-family: myFirstFont;
  src: url(sansation_light.woff);
}

div {
  font-family: myFirstFont;
}

/*
  For more information, go to:
  https://www.w3schools.com/css/css3_fonts.asp
*/
19
@import url(//fonts.googleapis.com/css?family=Open+Sans);
/*When not hosting on my own server use the @import rule which is Google Fonts Versionn and hosted on their server*/
2
<link rel="stylesheet" href="<Font location>">
-1
@font-face { font-family: 'meine-schrift';
             src: url('pfad/zu/meinerschrift.ttf') format('truetype'); }
@font-face { font-family: 'meine-schrift';
             src: url('pfad/zu/meiner-kursiven-schrift.ttf') format('truetype');
             font-style: italic; }
@font-face { font-family: 'meine-schrift';
             src: url('pfad/zu/meiner-fetten-schrift.ttf') format('truetype');
             font-weight: bold; }
@font-face { font-family: 'meine-schrift';
             src: url('pfad/zu/meiner-kursiv-fetten-schrift.ttf') format('truetype');
             font-weight: bold;
             font-style: italic; }
-1

New to Communities?

Join the community