我正在嘗試為我的網站使用自定義字體,我使用的第一種字體很好用,但第二種似乎不太好用。我不知道為什么。我使用@font-face規則導入了這兩種字體,但是由于某種原因,我導入的第二種字體不起作用。
HTML文件
<!DOCTYPE html>
<html>
<head>
<title>Sanji's Kitchen</title>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="landingpage.css">
</head>
<body>
<div class="container">
<div class="title-wrapper">
<h1 class="title">Welcome to Sanji's Kitchen</h1>
</div>
<img class="image-centered" src="pixleonepiece.png" alt="Sanji Logo">
</div>
<div class="content-container">
<h2>Did you like the food?</h2>
<label>
<input type="radio" name="choice" value="yes">
Yes
</label>
<label>
<input type="radio" name="choice" value="no">
No
</label>
<br>
<label class="content-options">
Leave a review: <input type="text" name="text-field">
</label>
<br>
<label class="content-options">
Date: <input type="date" name="selected-date">
</label>
<br>
<br>
<input type="submit" value="Submit">
</div>
</body>
</html>
@font-face {
font-family: day dream;
src: url(fonts/Daydream.ttf);
}
@font-face {
font-family: pokemon;
src: url(fonts/pokemon_pixel_font.ttf);
}
.title-wrapper {
text-align: center;
}
.title {
font-size: 40px;
text-align: center;
font-family: day dream;
color: white;
text-shadow: 2px 2px #ff0000;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
margin-top: 20px;
}
.content-container {
background-color: #03a9f4;
padding: 20px;
margin-top: 20px;
width: 60%;
margin-left: auto;
margin-right: auto;
font-family: pokemon;
}
.content-options {
margin-bottom: 30px;
}
.content-options input {
margin-top: 10px;
}
body{
background-image: url(SSF2_Thousand_Sunny.png);
background-size:cover;
background-repeat: no-repeat;
font-family: pokemon;
}
不起作用的字體是口袋妖怪。任何幫助都將不勝感激。
我試著重新寫了一遍整個網站。