Properti text-stroke-width
Properti text-stroke-width mengatur ketebalan kontur
karakter teks atau stroke-nya. Properti
menerima nilai yang ditentukan dalam satuan ukuran
seperti px, em, rem, dll. Juga
dapat mengatur nilai-nilai berikut: thin (garis tipis),
medium (garis sedang) dan thick
(garis tebal).
Sintaks
selektor {
text-stroke-width: angka atau thin atau medium atau thick;
}
Contoh
Mari kita berikan stroke tipis pada karakter teks kita:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: thin;
text-stroke-width: thin;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
Contoh
Sekarang mari kita ubah stroke tipis menjadi stroke sedang:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: medium;
text-stroke-width: medium;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
Contoh
Mari kita berikan stroke tebal pada karakter teks kita:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: thick;
text-stroke-width: thick;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
Contoh
Juga, mari kita berikan stroke sebesar 2px pada karakter teks kita:
<p>
Text
</p>
body {
width: 100px;
height: 50px;
}
p {
-webkit-text-stroke-color: orange;
-webkit-text-stroke-width: 2px;
color: white;
font-size: 10em;
margin-top: 0;
font-weight: bold;
font-family: Arial;
}
:
Lihat juga
-
properti
text-stroke,
yang mengatur stroke teks -
properti
text-stroke-color,
yang mengatur warna stroke teks