CSS grid-auto-columnsคุณสมบัติ
ตัวอย่าง
กำหนดขนาดเริ่มต้นสำหรับคอลัมน์ในตาราง:
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
ความหมายและการใช้งาน
คุณสมบัติgrid-auto-columns
กำหนดขนาดสำหรับคอลัมน์ในคอนเทนเนอร์กริด
คุณสมบัตินี้มีผลกับคอลัมน์ที่ไม่ได้ตั้งค่าขนาดเท่านั้น
ค่าเริ่มต้น: | รถยนต์ |
---|---|
รับการถ่ายทอด: | ไม่ |
เคลื่อนไหวได้: | ใช่. อ่านเกี่ยวกับแอนิเมชั่น |
รุ่น: | CSS Grid Layout Module ระดับ 1 |
ไวยากรณ์ JavaScript: | วัตถุ .style.gridAutoColumns="120px" |
รองรับเบราว์เซอร์
ตัวเลขในตารางระบุเบราว์เซอร์รุ่นแรกที่สนับสนุนคุณสมบัติอย่างสมบูรณ์
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
ไวยากรณ์ CSS
grid-auto-columns: auto|max-content|min-content|length;
มูลค่าทรัพย์สิน
Value | Description | Play it |
---|---|---|
auto | Default value. The size of the columns is determined by the size of the container | |
fit-content() | ||
max-content | Sets the size of each column depending on the largest item in the column | |
min-content | Sets the size of each column depending on the smallest item in the column | |
minmax(min.max) | Sets a size range greater than or equal to min and less than or equal to max | |
length | Sets the size of the columns, by using a legal length value. Read about length units | |
% | Sets the size of the columns, by using a percent value |
หน้าที่เกี่ยวข้อง
บทช่วยสอน CSS: เค้าโครงตาราง CSS
การอ้างอิง CSS: คุณสมบัติgrid -auto-rows