สไตล์textIndent Property
ตัวอย่าง
เยื้องบรรทัดแรกของ <div> องค์ประกอบที่มี 50 พิกเซล:
document.getElementById("myDiv").style.textIndent = "50px";
ความหมายและการใช้งาน
คุณสมบัติ textIndent ตั้งค่าหรือส่งคืนการเยื้องของบรรทัดแรกของข้อความ
หมายเหตุ:อนุญาตให้ใช้ค่าลบ บรรทัดแรกจะถูกเยื้องไปทางซ้ายหากค่าเป็นลบ
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
textIndent | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
ส่งคืนคุณสมบัติ textIndent:
object.style.textIndent
ตั้งค่าคุณสมบัติ textIndent:
object.style.textIndent = "length|%|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
length | Defines the indentation in length units. Default value is 0 |
% | 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 |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | 0 |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงการเยื้องของบรรทัดแรกของข้อความในองค์ประกอบ |
เวอร์ชัน CSS | CSS1 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
กลับการเยื้องข้อความของ <div> องค์ประกอบ:
alert(document.getElementById("myDiv").style.textIndent);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Text
การอ้างอิง CSS: คุณสมบัติการเยื้องข้อความ
❮ สไตล์วัตถุ