คุณสมบัติการเยื้องข้อความ CSS
ตัวอย่าง
เยื้องบรรทัดแรกของข้อความที่มีค่าต่างกัน:
div.a {
text-indent: 50px;
}
div.b {
text-indent: -2em;
}
div.c {
text-indent:
30%;
}
ความหมายและการใช้งาน
คุณสมบัติระบุ การtext-indent
เยื้องของบรรทัดแรกในบล็อกข้อความ
หมายเหตุ: อนุญาตให้ใช้ค่าลบ บรรทัดแรกจะถูกเยื้องไปทางซ้ายหากค่าเป็นลบ
ค่าเริ่มต้น: | 0 |
---|---|
รับการถ่ายทอด: | ใช่ |
เคลื่อนไหวได้: | ใช่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS1 |
ไวยากรณ์ JavaScript: | วัตถุ .style.textIndent="50px" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
text-indent | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
ไวยากรณ์ CSS
text-indent: length|initial|inherit;
มูลค่าทรัพย์สิน
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 |
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Text
การอ้างอิง HTML DOM: คุณสมบัติ textIndent