خاصية CSS Grid-template-عمودي
مثال
اصنع حاوية شبكية من 4 أعمدة:
.grid-container {
display: grid;
grid-template-columns:
auto auto auto auto;
}
التعريف والاستخدام
تحدد الخاصية عدد ( وعرض grid-template-columns
) الأعمدة في تخطيط الشبكة.
القيم عبارة عن قائمة مفصولة بمسافات ، حيث تحدد كل قيمة حجم العمود المعني.
القيمة الافتراضية: | لا أحد |
---|---|
وارث: | رقم |
متحرك: | نعم. اقرأ عن animatable |
الإصدار: | وحدة تخطيط شبكة CSS المستوى 1 |
بناء جملة JavaScript: | الكائن .style.gridTemplateColumns = "50px 50px 50px" |
دعم المتصفح
تحدد الأرقام الواردة في الجدول إصدار المتصفح الأول الذي يدعم الخاصية بالكامل.
Property | |||||
---|---|---|---|---|---|
grid-template-columns | 57 | 16 | 52 | 10 | 44 |
بنية CSS
grid-template-columns: none|auto|max-content|min-content|length|initial|inherit;
قيم الملكية
Value | Description | Play it |
---|---|---|
none | Default value. Columns are created if needed | |
auto | The size of the columns is determined by the size of the container and on the size of the content of the items in the column | |
max-content | Sets the size of each column to depend on the largest item in the column | |
min-content | Sets the size of each column to depend on the smallest item in the column | |
length | Sets the size of the columns, by using a legal length value. Read about length units | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
مزيد من الأمثلة
مثال
اصنع حاوية شبكة من 4 أعمدة ، وحدد حجمًا لكل عمود:
.grid-container {
display: grid;
grid-template-columns:
30px 200px auto 100px;
}
الصفحات ذات الصلة
دروس CSS: تخطيط شبكة CSS
مرجع CSS: خاصية Grid-template-rows
مرجع CSS: خاصية قالب الشبكة