-2

I would like to use this code in Google Sites to use my font. Why isn't this working? My browser displays it as Times New Roman.

          @font-face {font-family: Johnston ITC; src: url('https://www.servizi.pcngroup.ch/johnston_light/johnstonitclight.ttf');} 
          h1 {
             font-family: Johnston_ITC
          }
          <h1>Hey, June</h1>

Some suggestions?

3 Answers3

1

Try this:

font-family: 'Johnston_ITC', sans-serif;
Zachary McGee
  • 504
  • 1
  • 4
  • 16
0

You have errors in your code. Try this:

@font-face {font-family: "Johnston ITC"; src: url('https://www.servizi.pcngroup.ch/johnston_light/johnstonitclight.ttf');} 
h1 { font-family: "Johnston ITC" }

you are calling the font "Johnston_ITC" and you have declared it as "Johnston ITC". And you've also forgotten the quotes.

enter image description here

Berta Nicolau
  • 128
  • 1
  • 8
0

Here you go. This src works correctly

<html>
   <head>
    <style>
        @font-face {font-family: "Johnston ITC";
            src: url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.eot");
            src: url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.eot?#iefix") format("embedded-opentype"),
            url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.woff2") format("woff2"),
            url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.woff") format("woff"),
            url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.ttf") format("truetype"),
            url("//db.onlinewebfonts.com/t/9e4ee8bdd2b9e501b34e033920bdf36d.svg#Johnston ITC Std") format("svg");
        }
      h1 {
         font-family: "Johnston ITC"
      }
    </style>
   </head>
   <body>
      <h1>Hey, June</h1>
   </body>
</html>

Shown here

mewi
  • 342
  • 1
  • 3
  • 12