คุณสมบัติ พื้นฐาน CSS แบบยืดหยุ่น
ตัวอย่าง
ตั้งค่าความยาวเริ่มต้นของ flex-item ที่สองเป็น 100 พิกเซล:
div:nth-of-type(2) {
flex-basis:
100px;
}
ความหมายและการใช้งาน
คุณสมบัติระบุ ความflex-basis
ยาวเริ่มต้นของรายการที่ยืดหยุ่นได้
หมายเหตุ:หากองค์ประกอบไม่ใช่รายการที่ยืดหยุ่นflex-basis
คุณสมบัติจะไม่มีผล
ค่าเริ่มต้น: | รถยนต์ |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ใช่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS3 |
ไวยากรณ์ JavaScript: | วัตถุ .style.flexBasis="200px" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
ตัวเลขตามด้วย -webkit- หรือ -moz- ระบุเวอร์ชันแรกที่ทำงานกับคำนำหน้า
Property | |||||
---|---|---|---|---|---|
flex-basis | 29.0 21.0 -webkit- |
11.0 | 28.0 18.0 -moz- |
9.0 6.1 -webkit- |
17.0 |
ไวยากรณ์ CSS
flex-basis: number|auto|initial|inherit;
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
number | A length unit, or percentage, specifying the initial length of the flexible item(s) | |
auto | Default value. The length is equal to the length of the flexible item. If the item has no length specified, the length will be according to its content | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
หน้าที่เกี่ยวข้อง
บทช่วยสอน CSS: CSS Flexible Box
การอ้างอิง CSS: คุณสมบัติ flex
การอ้างอิง CSS: คุณสมบัติ flex-direction
การอ้างอิง CSS: คุณสมบัติ flex-flow
การอ้างอิง CSS: คุณสมบัติ flex-grow
การอ้างอิง CSS: คุณสมบัติ flex-shrink
การอ้างอิง CSS: คุณสมบัติ flex-wrap
การอ้างอิง HTML DOM: คุณสมบัติ flexBasis