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

cssselektor {
  text-stroke-width: angka atau thin atau medium atau thick;
}

Contoh

Mari kita berikan stroke tipis pada karakter teks kita:

html<p>
  Text
</p>
cssbody {
  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:

html<p>
  Text
</p>
cssbody {
  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:

html<p>
  Text
</p>
cssbody {
  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:

html<p>
  Text
</p>
cssbody {
  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