शैली फ़ॉन्टसाइज़ संपत्ति
उदाहरण
किसी तत्व का फ़ॉन्ट आकार "x-बड़े" पर सेट करें:
document.getElementById("demo").style.fontSize = "x-large";
परिभाषा और उपयोग
FontSize गुण टेक्स्ट का फ़ॉन्ट आकार सेट या लौटाता है।
ब्राउज़र समर्थन
Property | |||||
---|---|---|---|---|---|
fontSize | Yes | Yes | Yes | Yes | Yes |
वाक्य - विन्यास
फ़ॉन्ट आकार संपत्ति वापस करें:
object.style.fontSize
फ़ॉन्ट आकार संपत्ति सेट करें:
object.style.fontSize = "value|initial|inherit"
सम्पत्ति की कीमत
Value | Description |
---|---|
xx-small x-small small medium large x-large xx-large |
Sets the size of the font to different fixed sizes, from xx-small to xx-large |
smaller | Decreases the font-size by one relative unit |
larger | Increases the font-size by one relative unit |
length | Defines the font-size in length units |
% | Sets the font-size to a % of the parent element's font size |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
टेक्निकल डिटेल
डिफ़ॉल्ट मान: | मध्यम |
---|---|
प्रतिलाभ की मात्रा: | तत्व में पाठ के फ़ॉन्ट आकार का प्रतिनिधित्व करने वाला एक स्ट्रिंग |
सीएसएस संस्करण | सीएसएस 1 |
और ज्यादा उदाहरण
उदाहरण
संभावित मूल्यों का प्रदर्शन:
var listValue = selectTag.options[selectTag.selectedIndex].text;
document.getElementById("demo").style.fontSize = listValue;
उदाहरण
किसी तत्व का फ़ॉन्ट आकार लौटाएं:
alert(document.getElementById("demo").style.fontSize);
संबंधित पृष्ठ
सीएसएस ट्यूटोरियल: सीएसएस फ़ॉन्ट
सीएसएस संदर्भ: फ़ॉन्ट-आकार की संपत्ति
HTML DOM संदर्भ: फ़ॉन्ट गुण
❮ स्टाइल ऑब्जेक्ट