Computer >> कंप्यूटर >  >> प्रोग्रामिंग >> HTML

एचटीएमएल डोम स्टाइल कॉलमगैप प्रॉपर्टी

<घंटा/>

HTML DOM Style columnGap प्रॉपर्टी का इस्तेमाल किसी एलिमेंट के कॉलम के बीच स्पेस को निर्दिष्ट करने के लिए किया जाता है।

. के लिए वाक्य रचना निम्नलिखित है

कॉलमगैप प्रॉपर्टी सेट करना -

object.style.columnGap = "length|normal|initial|inherit"

उपरोक्त गुणों को इस प्रकार समझाया गया है -

<वें शैली ="पाठ-संरेखण:केंद्र;">विवरण
मान
लंबाई स्तंभों के बीच गैप सेट करने के लिए प्रयुक्त लंबाई निर्दिष्ट करना
सामान्य यह डिफ़ॉल्ट मान है जो स्तंभों के बीच 1em के अंतर को निर्दिष्ट करता है।
आरंभिक इस गुण को प्रारंभिक मान पर सेट करने के लिए।
इनहेरिट करें मूल संपत्ति मूल्य प्राप्त करने के लिए

आइए कॉलमगैप प्रॉपर्टी के लिए एक उदाहरण देखें -

उदाहरण

<!DOCTYPE html>
<html>
<head>
<style>
   div {
      column-count: 4;
      column-gap: 50px;
      font-size: 1.2rem;
   }
</style>
<script>
   function changeColumnGap(){
      document.getElementsByTagName("div")[0].style.columnGap="10px";
      document.getElementById("Sample").innerHTML="The column gap is now decreased";
   }
</script>
</head>
<body>
   <div>
      This is some sample text inside div. This is the second div line.This is the third div
      line.This is the fourth div line. This is the fifth div line.This is the sixth div line.
      This is the seventh div line. This is the eigtth div line.This is the ninth div line. This is
      the tenth div line.This is the eleventh div line. This is the twelth div line.This is the  thirteenth div
      line.This is the fourteen line. This is the fifteen div line.This is the sixteen div line. This  is the seventeen div line. This is the eighteen div line.
   </div>
   <p>Change the above div column gap by clicking the below button</p>
   <button onclick="changeColumnGap()">Change Column Gap</button>
   <p id="Sample"></p>
</body>
</html>

आउटपुट

एचटीएमएल डोम स्टाइल कॉलमगैप प्रॉपर्टी

“कॉलम गैप बदलें” . पर क्लिक करने पर बटन -

एचटीएमएल डोम स्टाइल कॉलमगैप प्रॉपर्टी


  1. HTML DOM स्टाइल फ्लेक्सडायरेक्शन प्रॉपर्टी

    HTML DOM Style flexDirection प्रॉपर्टी का उपयोग फ्लेक्स तत्वों के प्लेसमेंट की दिशा निर्धारित करने या वापस करने के लिए किया जाता है। − . के लिए वाक्य रचना निम्नलिखित है फ्लेक्सडायरेक्शन प्रॉपर्टी सेट करना - object.style.flexDirection = "row|row-reverse|column|column-reverse|initial|inherit&qu

  1. HTML DOM स्टाइल फ्लेक्स प्रॉपर्टी

    HTML DOM स्टाइल फ्लेक्स प्रॉपर्टी का उपयोग फ्लेक्स पर सेट डिस्प्ले प्रॉपर्टी वाले तत्वों के लिए लचीली लंबाई को सेट करने या वापस करने के लिए किया जाता है। इसका उपयोग flexGrow, flexShrink और flexBasis गुणों में हेरफेर करने के लिए किया जाता है। − . के लिए वाक्य रचना निम्नलिखित है फ्लेक्स प्रॉपर्टी से

  1. HTML DOM स्टाइल जस्टिफाई कंटेंट प्रॉपर्टी

    HTML DOM JustifyContent प्रॉपर्टी का उपयोग फ्लेक्स आइटम को मुख्य अक्ष पर क्षैतिज रूप से संरेखित करने के लिए किया जाता है, जब यह सभी उपलब्ध स्थान नहीं लेता है। − . के लिए वाक्य रचना निम्नलिखित है JustifyContent प्रॉपर्टी सेट करना - object.style.justifyContent = "flex-start|flex-end|center|spac