“cara menggunakan font lokal di CSS” Kode Jawaban

Gunakan .TTF di CSS

@font-face {
  font-family:"Name-Of-Font";
  src: url("yourfont.ttf") format("truetype");
}
Nasty Newt

Gunakan Font CSS lokal

<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
    font-family: myFirstFont;
    src:url("/fonts/Harlow_Solid_Italic.ttf");
}

.harlow{
    font-family: myFirstFont;
}
</style>
</head>
<body>
<div>With CSS3, websites can finally use fonts other than the pre selected "web-safe" fonts.</div>
<p><b class="harlow">Note:</b> Internet Explorer 8 and earlier, do not support the @font-face rule with the WOFF format (only support for EOT format).</p>
</body>
</html>
Shurvir Mori

Cara menautkan font yang diinstal secara lokal ke CSS

<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
    font-family: "myFirstFont";
    src: url("C:/Users/Desktop/Website/fonts/Harlow_Solid_Italic.ttf");
}

.harlow {
    font-family: "myFirstFont";
}
</style>
</head>
<body>
<div>With CSS3, websites can finally use fonts other than the pre selected "web-safe" fonts.</div>
<p><b class="harlow">Note:</b> Internet Explorer 8 and earlier, do not support the @font-face rule with the WOFF format (only support for EOT format).</p>
</body>
</html>
Repulsive Raven

cara menautkan font css

@font-face {
  font-family: myFirstFont;
  src: url(sansation_light.woff);
}

div {
  font-family: myFirstFont;
}
/*Name the font-family and link the font file in the @font-face rule*/
OptimusRiemann

Jika Anda mencoba menggunakan paket, pastikan bahwa ../../static/fonts/lato/lato-regular.woff diinstal. Jika Anda mencoba menggunakan file lokal, pastikan jalurnya benar.

/** Use intstead */
@font-face {
  font-family: 'MyFont';
  src: local('MyFont'), url(fonts/MyFont.woff) format('woff');
}
Salo Hopeless

cara menggunakan font lokal di CSS

<!DOCTYPE html>
<html>
<head>
<style>
@font-face {
    font-family: myFirstFont;
    src:local("fonts\Harlow_Solid_Italic.ttf");
}

.harlow{
    font-family: myFirstFont, sans-serif;
}
</style>
</head>
<body>
<div>With CSS3, websites can finally use fonts other than the pre selected "web-safe" fonts.</div>
<p><b class="harlow">Note:</b> Internet Explorer 8 and earlier, do not support the @font-face rule with the WOFF format (only support for EOT format).</p>
</body>
</html>
Hurt Hummingbird

Jawaban yang mirip dengan “cara menggunakan font lokal di CSS”

Pertanyaan yang mirip dengan “cara menggunakan font lokal di CSS”

Lebih banyak jawaban terkait untuk “cara menggunakan font lokal di CSS” di CSS

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya