Aturan @font-face memungkinkan web desainer menggunakan font tipografi khusus di luar font standar komputer klien.
CSS Custom Fonts
Contoh Kode CSS Custom Fonts:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fira+Code:wght@600&display=swap">
<style>
.font-kustom {
font-family: 'Fira Code', monospace;
font-size: 20px;
color: #04AA6D;
background: #1e293b;
padding: 20px;
border-radius: 8px;
}
</style>
</head>
<body>
<div class="font-kustom">
const engineer = "Skillance Academy";
</div>
</body>
</html>
Uji dan amati bagaimana deklarasi CSS CSS Custom Fonts mengubah tampilan elemen di atas.