सीएसएस ग्रिड-टेम्पलेट-कॉलम संपत्ति
उदाहरण
4 कॉलम का ग्रिड कंटेनर बनाएं:
.grid-container {
display: grid;
grid-template-columns:
auto auto auto auto;
}
परिभाषा और उपयोग
grid-template-columns
गुण ग्रिड लेआउट में स्तंभों की संख्या (और चौड़ाई) निर्दिष्ट करता है ।
मान एक स्थान से अलग की गई सूची है, जहां प्रत्येक मान संबंधित कॉलम के आकार को निर्दिष्ट करता है।
डिफ़ॉल्ट मान: | कोई नहीं |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | हां। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | CSS ग्रिड लेआउट मॉड्यूल स्तर 1 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.gridTemplateColumns="50px 50px 50px" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
grid-template-columns | 57 | 16 | 52 | 10 | 44 |
सीएसएस सिंटेक्स
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 संदर्भ: ग्रिड-टेम्पलेट गुण