HTML DOM स्टाइल लेटरस्पेसिंग प्रॉपर्टी का इस्तेमाल टेक्स्ट के बीच कैरेक्टर स्पेस को सेट करने या पाने के लिए किया जाता है।
−
. के लिए वाक्य रचना निम्नलिखित हैलेटरस्पेसिंग प्रॉपर्टी सेट करना -
object.style.letterSpacing = "normal|length|initial|inherit"
उपरोक्त गुणों को इस प्रकार समझाया गया है -
| मान वें> <वें>विवरण वें> | |
|---|---|
| सामान्य | यह डिफ़ॉल्ट गुण है और वर्ण स्थान को सामान्य पर सेट करता है। |
| लंबाई | लंबाई इकाइयों और ऋणात्मक मानों में वर्ण स्थान निर्दिष्ट करने की भी अनुमति है। |
| प्रारंभिक | इस गुण को प्रारंभिक मान पर पूर्वनिर्धारित करना। |
| उत्तराधिकारी | मूल संपत्ति मान को विरासत में मिला |
आइए लेटरस्पेसिंग प्रॉपर्टी के लिए एक उदाहरण देखें:
उदाहरण
<!DOCTYPE html>
<html>
<head>
<script>
function changeSpacing() {
document.getElementById("myP").style.letterSpacing = "12px";
document.getElementById("Sample").innerHTML = "The space between characters is now increased";
}
</script>
</head>
<body>
<p id="myP">This is some text inside the sample paragraph. This is another line in paragraph. This is second line in paragraph. This is third line in paragraph. </p>
<p>Increase the space between characters in the above paragraph by clicking the below button</p>
<button type="button" onclick="changeSpacing()">Increase Letter Spacing</button>
<p id="Sample"></p>
</body>
</html> आउटपुट

“अक्षर की रिक्ति बढ़ाएँ . पर क्लिक करने पर "बटन -
