@font-face {
// Defining what the font will be called
font-family: thisSpecialFont;
// Linking to the font file
src: url(linkToFontFile.woff);
}
body {
font-family: thisSpecialFont;
}
@font-face {
font-family: 'PacificoRegular';
src: url('Pacifico-webfont.eot');
src: url('Pacifico-webfont.eot?#iefix') format('embedded-opentype'),
url('Pacifico-webfont.woff') format('woff'),
url('Pacifico-webfont.ttf') format('truetype'),
url('Pacifico-webfont.svg#PacificoRegular') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Open Sans";
src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}
The following syntax is how you use @font-face. First, you define the new font by providing it a name and stating where the font can be found.
@font-face {
font-family: DeliciousRoman;
src: url('https://www.font-face.com/fonts/delicious/Delicious-Roman.otf');
}
And then you refenence it.
p {
font-family: DeliciousRoman, Helvetica, Arial, sans-serif;
}
that's it.
Code Example |
---|
Css :: css background text clip |
Css :: css fade change coloir |
Css :: using inline styling in React |
Css :: css to increase font size |
Css :: rgba blue |
Css :: block elements css |
Css :: how to change link color hover button text |
Css :: line height tailwind |
Css :: call css html |
Css :: estilos de button css |
Css :: hide in css |
Css :: DOM element add multiple attributes |
Css :: round image css |
Css :: ckeditor push text in front of cursor |
Css :: how to ignore an element from the flexbox container |
Css :: round the value of 2 decimals in java |
Css :: style button for safari |
Css :: ellipsis |
Css :: css flex add second row |
Css :: button material ui |
Css :: angular css animation |
Css :: id ends with css |
Css :: change parent div css on over of child |
Css :: Flexbox vs. CSS Grid |
Css :: css basic template |
Css :: css break text no whitespace |
Css :: position absolute and relative css |
Css :: css display flex white-space: nowrap; |
Css :: css padding property |
Css :: amp pages lcp |