Die font-face opdrag
Die opdrag @font-face laat jou toe om
'n gebruiker lettertipe te spesifiseer, waarvan die bron
in 'n lêer gestoor is. Hierdie lettertipe kan dan
met die eienskap font-family aangesluit word.
Sintaksis
@font-face {
lettertipe naam;
bron om lettertipe te soek;
}
Voorbeeld
Kom ons vind 'n lettertipe op ons plaaslike rekenaar:
<body>
This is Montserrat SemiBold.
</body>
@font-face {
font-family: "Montserrat SemiBold";
src: local("Montserrat SemiBold");
}
body {
font-family: "Montserrat SemiBold";
}
#elem {
animation: anim 3s infinite;
border: 1px solid black;
width: 50px;
height: 50px;
}
:
Voorbeeld
En nou, spesifiseer ons 'n afgeleë bediener se adres om die lettertipe te soek:
<body>
This is Bitstream Vera Serif Bold.
</body>
@font-face {
font-family: "Bitstream Vera Serif Bold";
src: url("https://mdn.github.io/css-examples/web-fonts/VeraSeBd.ttf");
}
body {
font-family: "Bitstream Vera Serif Bold", serif;
}
#elem {
animation: anim 3s infinite;
border: 1px solid black;
width: 50px;
height: 50px;
}
: