I am trying to install a custom local font but it doesn't look like it's working.
style.css:
@font-face {
font-family: "TTNorms";
src: url("./fonts/TTNorms.eot");
src: url("./fonts/TTNorms.eot?#iefix") format("embedded-opentype"),
url("./fonts/TTNorms.woff2") format("woff2"),
url("./fonts/TTNorms.woff") format("woff"),
url("./fonts/TTNorms.ttf") format("truetype"),
url("./fonts/TTNorms.svg#TTNorms-Regular") format("svg");
font-weight: normal;
font-style: normal;
}
My fonts folder:
fonts
├── TTNorms-Regular.eot
├── TTNorms-Regular.svg
├── TTNorms-Regular.ttf
├── TTNorms-Regular.woff
├── TTNorms-Regular.woff2
However, when I try to set any element's font-family: "TTNorms"
it doesn't work. What am I doing wrong?
I am trying to install a custom local font but it doesn't look like it's working.
style.css:
@font-face {
font-family: "TTNorms";
src: url("./fonts/TTNorms.eot");
src: url("./fonts/TTNorms.eot?#iefix") format("embedded-opentype"),
url("./fonts/TTNorms.woff2") format("woff2"),
url("./fonts/TTNorms.woff") format("woff"),
url("./fonts/TTNorms.ttf") format("truetype"),
url("./fonts/TTNorms.svg#TTNorms-Regular") format("svg");
font-weight: normal;
font-style: normal;
}
My fonts folder:
fonts
├── TTNorms-Regular.eot
├── TTNorms-Regular.svg
├── TTNorms-Regular.ttf
├── TTNorms-Regular.woff
├── TTNorms-Regular.woff2
However, when I try to set any element's font-family: "TTNorms"
it doesn't work. What am I doing wrong?
It's probably how you're referencing the fonts from the css. Assuming "style.css" and "fonts" directories are on the same level, your code should work. Are you using a bundler (Webpack or Gulp)? Either could resolve your issue quickly.