How to insert specific fonts in CSS? [duplicate]

3

My client has passed specific fonts to a site. These are in TTF format.

I'm used to using Google's fonts and there are not any there.

How can I use these fonts in my CSS or HTML?

    
asked by anonymous 19.11.2017 / 22:36

1 answer

3

Publish your fonts on the server. Example raleway-bold.ttf

CSS

@font-face {
    font-family: ralewayExtralight;
    src: url(raleway-extralight.ttf);
}


@font-face {
    font-family: ralewayBold;
    src: url(raleway-bold.ttf);
}

.Extralight {
    font-family: ralewayExtralight;
}

.Bold {
    font-family: ralewayBold;
}

HTML

<p class="Extralight">Estilo de font importada: raleway-extralight.ttf</p>

<p class="Bold">Estilo de font importada: raleway-bold.ttf</p>

Appearance in browsers:

Google Chrome:

Firefox:

Opera:

Safari:

InternetExplorer:

    
19.11.2017 / 23:36