I'm trying to load a custon font via @font-face
, serving the font file over localhost.
style.css:
@font-face {
font-family: 'Lobster';
font-style: normal;
font-weight: 400;
src: url(Lobster-Regular.ttf) format('ttf');
}
body {
font-family: "Lobster";
font-size: 28px;
}
index.html:
<!DOCTYPE hmtl>
<html>
<head>
<meta charset="utf8"/>
<title>@font-face test</title>
<link rel="stylesheet" href="style.css"/>
<head>
<body>
<p>Where is my font?!</p>
<body>
</html>
These two files plus the Lobster-Regular.ttf reside on the same directory. But when I access this page, the Lobster font don't load. I am requesting the page to my local server, and not simply loading the HTML file over Firefox. I checked the network monitor, and the font file did not even got loaded. Any ideas?