How to change the font-family of a single div with .tff file?

0

I would like to change the font-family of a particular div to a font that I can not find the code, but I found a font file. How can I add this font? Is there a code for it?

In this link I found the font I want.

    
asked by anonymous 09.10.2017 / 19:53

1 answer

1

After downloading the font, you will see some files with .ttf, .otf extension, among others. Adds these files to the project folder, usually I paste them into public / fonts.

To add and use the source in the code we use @font-face , this is known with importing source:

@font-face {
     font-family: "NomeDaFonte;
     src: url("arquivo-fote.otf");
}

In the font-family tag you enter the name that you will use. In the second tag src you put the location where the downloaded files are located.

Now to add in a div specifies:

.minha-div{
     font-family: "NomeDaFonte";
}
    
09.10.2017 / 20:03