CSS टेक्स्ट-एलाइन प्रॉपर्टी
उदाहरण
विभिन्न <div> तत्वों के लिए टेक्स्ट संरेखण सेट करें:
div.a {
text-align: center;
}
div.b {
text-align: left;
}
div.c {
text-align: right;
}
div.c {
text-align:
justify;
}
नीचे और अधिक "इसे स्वयं आज़माएं" उदाहरण।
परिभाषा और उपयोग
गुण किसी तत्व में पाठ के क्षैतिज संरेखण को text-align
निर्दिष्ट करता है।
डिफ़ॉल्ट मान: | बाएं अगर दिशा लीटर है, और सही अगर दिशा rtl . है |
---|---|
विरासत में मिला: | हां |
एनिमेटेबल: | नहीं। एनिमेटेबल के बारे में पढ़ें |
संस्करण: | सीएसएस 1 |
जावास्क्रिप्ट सिंटैक्स: | ऑब्जेक्ट .style.textAlign = "दाएं" |
ब्राउज़र समर्थन
तालिका में संख्याएं पहले ब्राउज़र संस्करण को निर्दिष्ट करती हैं जो पूरी तरह से संपत्ति का समर्थन करता है।
Property | |||||
---|---|---|---|---|---|
text-align | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
सीएसएस सिंटेक्स
text-align: left|right|center|justify|initial|inherit;
सम्पत्ति की कीमत
Value | Description | Play it |
---|---|---|
left | Aligns the text to the left | |
right | Aligns the text to the right | |
center | Centers the text | |
justify | Stretches the lines so that each line has equal width (like in newspapers and magazines) | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
और ज्यादा उदाहरण
उदाहरण
एक और पाठ-संरेखण उदाहरण:
h1 {
text-align: center;
}
p.date {
text-align: right;
}
p.main {
text-align: justify;
}
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस टेक्स्ट
एचटीएमएल डोम संदर्भ: टेक्स्ट एलाइन संपत्ति