สไตล์แนวตั้งAlign Property
ตัวอย่าง
ตั้งค่าการจัดตำแหน่งแนวตั้งของข้อความในตารางเป็น "ด้านล่าง":
document.getElementById("myTd").style.verticalAlign = "bottom";
ความหมายและการใช้งาน
ชุดคุณสมบัติ verticalAlign หรือส่งคืนการจัดตำแหน่งแนวตั้งของเนื้อหาในองค์ประกอบ
รองรับเบราว์เซอร์
Property | |||||
---|---|---|---|---|---|
verticalAlign | Yes | Yes | Yes | Yes | Yes |
ไวยากรณ์
ส่งคืนคุณสมบัติ verticalAlign:
object.style.verticalAlign
ตั้งค่าคุณสมบัติ verticalAlign:
object.style.verticalAlign = value
มูลค่าทรัพย์สิน
Value | Description |
---|---|
length | Raises or lower an element by the specified length. Negative values are allowed |
% | Raises or lower an element in a percent of the "line-height" property. Negative values are allowed |
baseline | Align the baseline of the element with the baseline of the parent element. This is default |
sub | Aligns the element as it was subscript |
super | Aligns the element as it was superscript |
top | The top of the element is aligned with the top of the tallest element on the line |
text-top | The top of the element is aligned with the top of the parent element's font |
middle | The element is placed in the middle of the parent element |
bottom | The bottom of the element is aligned with the lowest element on the line |
text-bottom | The bottom of the element is aligned with the bottom of the parent element's font |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | พื้นฐาน |
---|---|
คืนมูลค่า: | สตริงที่แสดงถึงการจัดตำแหน่งแนวตั้งของเนื้อหาในองค์ประกอบ |
เวอร์ชัน CSS | CSS1 |
ตัวอย่างเพิ่มเติม
ตัวอย่าง
กลับการจัดตำแหน่งแนวตั้งของ <td> องค์ประกอบ:
alert(document.getElementById("myTd").style.verticalAlign);
หน้าที่เกี่ยวข้อง
กวดวิชา CSS: CSS Text
การอ้างอิง CSS: คุณสมบัติการจัดแนวแนวตั้ง
❮ สไตล์วัตถุ