จัด รูปแบบคุณสมบัติตนเอง
ตัวอย่าง
ตั้งค่าการจัดตำแหน่งสำหรับรายการใดรายการหนึ่งภายในองค์ประกอบที่ยืดหยุ่นเพื่อให้พอดีกับคอนเทนเนอร์:
document.getElementById("myBlueDiv").style.alignSelf = "stretch";
ความหมายและการใช้งาน
คุณสมบัติ alignSelf ระบุการจัดตำแหน่งสำหรับรายการที่เลือกภายในคอนเทนเนอร์แบบยืดหยุ่น
หมายเหตุ:คุณสมบัติ alignSelf จะแทนที่คุณสมบัติ alignItems ของคอนเทนเนอร์แบบยืดหยุ่น
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Numbers ตามด้วย Webkit ระบุเวอร์ชันแรกที่ใช้งานได้กับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
alignSelf | 21.0 | 11.0 | 20.0 | 9.0 7.0 Webkit |
12.1 |
ไวยากรณ์
ส่งคืนคุณสมบัติ alignSelf:
object.style.alignSelf
ตั้งค่าคุณสมบัติ alignSelf:
object.style.alignSelf = "auto|stretch|center|flex-start|flex-end|baseline|initial|inherit"
มูลค่าทรัพย์สิน
Value | Description |
---|---|
auto | Default. The element inherits its parent container's align-items property, or "stretch" if it has no parent container |
stretch | The element is positioned to fit the conatiner |
center | The element is positioned at the center of the container |
flex-start | The element is are positioned at the beginning of the container |
flex-end | The element is positioned at the end of the container |
baseline | The element is positioned at the baseline of the container |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
รายละเอียดทางเทคนิค
ค่าเริ่มต้น: | รถยนต์ |
---|---|
คืนมูลค่า: | A String แทนคุณสมบัติ align-self ขององค์ประกอบ |
เวอร์ชัน CSS | CSS3 |
หน้าที่เกี่ยวข้อง
การอ้างอิง CSS: align-self property
อ้างอิง HTML DOM STYLE: alignContent property
การอ้างอิง HTML DOM STYLE: alignItems property