सीएसएस संरेखण-आइटम संपत्ति
उदाहरण
लचीले <div> तत्व के सभी आइटम के लिए संरेखण को केंद्र में रखें:
div
{
display: flex;
align-items: center;
}
परिभाषा और उपयोग
गुण लचीले कंटेनर के align-items
अंदर आइटम के लिए डिफ़ॉल्ट संरेखण निर्दिष्ट करता है।
युक्ति: संपत्ति को ओवरराइड करने के लिए प्रत्येक आइटम की align-self प्रॉपर्टी का उपयोग करें align-items
।
डिफ़ॉल्ट मान: | फैलाव |
---|---|
विरासत में मिला: | नहीं |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | CSS3 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.alignItems="center" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
-वेबकिट के बाद की संख्याएं- उपसर्ग के साथ काम करने वाले पहले संस्करण को निर्दिष्ट करें।
Property | |||||
---|---|---|---|---|---|
align-items | 21.0 | 11.0 | 20.0 | 9.0 7.0 -webkit- |
12.1 |
सीएसएस सिंटेक्स
align-items: stretch|center|flex-start|flex-end|baseline|initial|inherit;
सम्पत्ति की कीमत
Value | Description | Play it |
---|---|---|
stretch | Default. Items are stretched to fit the container | |
center | Items are positioned at the center of the container | |
flex-start | Items are positioned at the beginning of the container | |
flex-end | Items are positioned at the end of the container | |
baseline | Items are 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 |
संबंधित पृष्ठ
सीएसएस संदर्भ: संरेखित-सामग्री संपत्ति
सीएसएस संदर्भ: संरेखित-स्वयं संपत्ति
HTML DOM संदर्भ: alignItems गुण