Properti indentasi teks CSS
Contoh
Indentasi baris pertama teks dengan nilai yang berbeda:
div.a {
text-indent: 50px;
}
div.b {
text-indent: -2em;
}
div.c {
text-indent:
30%;
}
Definisi dan Penggunaan
Properti text-indent
menentukan indentasi baris pertama dalam blok teks.
Catatan: Nilai negatif diperbolehkan. Baris pertama akan menjorok ke kiri jika nilainya negatif.
Nilai bawaan: | 0 |
---|---|
Diwarisi: | Ya |
Animasi: | Ya. Baca tentang animasi |
Versi: kapan: | CSS1 |
Sintaks JavaScript: | objek .style.textIndent="50px" |
Dukungan Peramban
Angka-angka dalam tabel menentukan versi browser pertama yang sepenuhnya mendukung properti.
Property | |||||
---|---|---|---|---|---|
text-indent | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
Sintaks CSS
text-indent: length|initial|inherit;
Nilai properti
Value | Description | Play it |
---|---|---|
length | Defines a fixed indentation in px, pt, cm, em, etc. Default value is 0. Read about length units | |
% | Defines the indentation in % of the width of the parent element | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Halaman Terkait
Tutorial CSS: Teks CSS
Referensi HTML DOM: properti textIndent