问题
I am trying to add a Font to a website im making using @Font-Face but its not working. I did it exactly like in the link above, but its not working.
My Code:
@font-face {
font-family: 04B;
src: url("04b.ttf") format('truetype');
}
table {
margin:auto;
text-align:center;
font-size:40px;
font-family: 04B;
table-layout: fixed;
width: 100%;
}
h1 {
text-align:center;
font-size:50px;
font-family: 04B;
}
<h1>Problem is that the font displays exactly like it does in this demo window but shouldnt since I added a font</h1>
Also the font im trying to use is a TTF font which I got from here. The font is also located in the same directory as the CSS file so I think that should be totally fine
I tried testing it in Edge, IE and Chrome and its always the same...
Am I just being really stupid and missing something?
回答1:
Making a kit like Pangloss suggested in the comments seems to have fixed it. Im still not sure what I did wrong, but following the exact instructions of the Kit worked perfectly :D
来源:https://stackoverflow.com/questions/33188906/ttf-font-not-being-displayed-when-using-font-family