为什么不应用font-family?
这是HTML:
<div class='reelShelf'>
<div class="reel creatures" id="horseReel">
<div class="reelTitle">Avi & Rosie</div>
<img class="photo" src="photos/creatures/horse1.jpg" onclick="fullView('creatures/horse1')" />
<img class="photo" src="photos/creatures/horse2.jpg" onclick="fullView('creatures/horse2')" />
<img class="photo" src="photos/creatures/horse3.jpg" onclick="fullView('creatures/horse3')" />
<img class="photo" src="photos/creatures/horse4.jpg" onclick="fullView('creatures/horse4')" />
<img class="photo" src="photos/creatures/horse5.jpg" onclick="fullView('creatures/horse5')" />
<img class="photo" src="photos/creatures/horse6.jpg" onclick="fullView('creatures/horse6')" />
<img class="photo" src="photos/creatures/horse7.jpg" onclick="fullView('creatures/horse7')" />
<img class="photo" src="photos/creatures/horse8.jpg" onclick="fullView('creatures/horse8')" />
<img class="photo" src="photos/creatures/horse9.jpg" onclick="fullView('creatures/horse9')" />
</div>
</div>
这是CSS:
@font-face
{
font-family: Corsiva;
src: url(fonts/MTCORSVA.TFF);
}
.reelTitle
{
color: white;
flex: 0 0 auto;
width: 100%;
font-family: Corsiva;
}
最后,这是一张参考照片:
答案 0 :(得分:0)
你错过了font-family周围的单引号。
@font-face
{
font-family: 'Corsiva';
src: url(fonts/MTCORSVA.TFF);
}
.reelTitle
{
color: white;
flex: 0 0 auto;
width: 100%;
font-family: 'Corsiva';
}