CSS - dekorasi teks

Deskripsi

The text-decoration properti digunakan untuk menambahkan "dekorasi" untuk konten inline.

Nilai yang Mungkin

  • none - Tidak ada dekorasi yang harus ditambahkan ke teks sebaris.

  • underline - Garis bawah digambar di bawah teks sebaris.

  • overline - Garis besar digambar di atas teks sebaris.

  • line-through - Garis harus ditarik di tengah teks sebaris.

  • blink - Teks sebaris harus berkedip dan mati, serupa dengan elemen BLINK yang diperkenalkan oleh Netscape.

Berlaku untuk

Semua elemen HTML.

Sintaks DOM

object.style.textDecoration = "underline";

Contoh

Berikut adalah contoh yang menunjukkan cara menghias teks.

NOTE - Properti Blink tidak bekerja dengan semua browser.

<html>
   <head>
   </head>

   <body>
      <p style = "text-decoration:underline;">
         This will be underlined
      </p>
      
      <p style = "text-decoration:line-through;">
         This will be striked through.
      </p>
      
      <p style = "text-decoration:overline;">
         This will have a over line.
      </p>
      
      <p style = "text-decoration:blink;">
         This text will have blinking effect
      </p>
   </body>
</html>

Ini akan menghasilkan hasil sebagai berikut -


Language