0

Can someone tell me what to put in my css file to install a font named "Burbank.otf" and what to put in the html to make the text in that font

I have this in HTML:

<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
   <body>
      <h1>Hey, June</h1>
   </body>
</head>
</html>
<html>

<head>
  <title>Test</title>
</head>

And this in CSS:

@font-face { font-family: Junebug; src: url('Burbank.otf'); } 
.junebug { font-family: Junebug; font-size: 4.2em; }
Yordi
  • 23
  • 3
  • It’s 2019. Are we still not googling things before asking? Surely there was a recommended question similar to yours prior to posting just based off the title – soulshined Feb 09 '19 at 17:41
  • 1
    Possible duplicate of [Using custom fonts using CSS?](https://stackoverflow.com/questions/12144000/using-custom-fonts-using-css) – soulshined Feb 09 '19 at 17:43

3 Answers3

0

You are selecting the class .junebug in your css file, but there isn't any html tag with a class like that.

Your CSS:

@font-face { font-family: Junebug; src: url('Burbank.otf'); } 
.junebug { font-family: Junebug; font-size: 4.2em; }

Give an html tag the class junebug eg:

<h1 class="junebug">Hey, June</h1>
newbiedude
  • 51
  • 1
  • 5
0

you can use it simply like this :

@font-face {
  font-family: Burbank.otf ;
  src: "url from the font"
}

your cla{
  font-family: Burbank.otf;
}

I hope this will help .

0

If your font is in the same folder of the HTML you can use this css:

@font-face {
    font-family:'Burbank';
    src: url('Burbank.otf') format('opentype');
    font-style: normal;
    font-weight: normal;
}
.junebug { font-family: Burbank; font-size: 4.2em; }

To make it works you need to use the same font-family name as the name of the font file.

Davide Casiraghi
  • 15,591
  • 9
  • 34
  • 56