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

CSS column-gap प्रॉपर्टी से कॉलम के बीच गैप निर्दिष्ट करें

CSS column-gap प्रॉपर्टी (पहले grid-column-gap ग्रिड के लिए) मल्टी-कॉलम लेआउट में कॉलम (स्तंभों) के बीच की जगह (गैप) निर्दिष्ट करती है। यह कॉलम कंटेंट के बीच पठनीयता के लिए आवश्यक स्पेस प्रदान करती है।

उदाहरण

नीचे दिए गए उदाहरण में, column-gap: 50px का उपयोग करके 4 कॉलम के बीच 50 पिक्सेल का गैप सेट किया गया है।

<!DOCTYPE html>
<html>
<head>
  <style>
    .demo {
      column-count: 4;
      column-gap: 50px;
    }
  </style>
</head>
<body>
  <div class="demo">
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text. This is demo text. This is demo text.
    This is demo text. This is demo text.
  </div>
</body>
</html>

column-gap के मान:

  • normal (डिफ़ॉल्ट): ब्राउजर डिफ़ॉल्ट (आमतौर पर 1em)
  • <length>: निश्चित लंबाई (50px, 2rem, 3%)
  • 0: कोई गैप नहीं (कॉलम मिल जाएंगे)

संबंधित: column-count (कॉलम संख्या), column-width (कॉलम चौड़ाई), column-rule (कॉलम के बीच रेखा)।

  1. CSS में ::first-line स्यूडो-एलिमेंट CSS में ::first-line स्यूडो-एलिमेंट

    CSS का ::first-line स्यूडो-एलिमेंट किसी एलिमेंट की सामग्री की पहली लाइन को चुनता है। हालांकि, यदि टेक्स्ट वाले कंटेनर की चौड़ाई निश्चित नहीं है, तो लाइन की लंबाई विंडो के आकार के अनुसार बदल सकती है। उदाहरण आइए CSS ::first-line स्यूडो-एलिमेंट का एक उदाहरण देखें: <!DOCTYPE html> <html> &l

  1. CSS में @media At-rules CSS में @media At-rules

    CSS @media नियम का उपयोग एक ही स्टाइल शीट में विभिन्न मीडिया टाइप्स (जैसे print, screen, all, आदि) के लिए अलग-अलग स्टाइल्स स्पेसिफाई करने के लिए किया जाता है। यह आमतौर पर मीडिया टाइप्स की कॉमा-सेपरेटेड लिस्ट और CSS डिक्लेरेशन ब्लॉक द्वारा फॉलो किया जाता है जिसमें टारगेट मीडिया के लिए स्टाइल नियम होत

  1. CSS से टेक्स्ट इंडेंटेशन CSS से टेक्स्ट इंडेंटेशन

    CSS text-indent प्रॉपर्टी हमें किसी एलिमेंट की पहली लाइन का इंडेंटेशन सेट करने में मदद करती है।सिंटैक्सCSS text-indent प्रॉपर्टी का सिंटैक्स निम्नलिखित है:Selector { text-indent: /*value*/ }उदाहरणनिम्नलिखित उदाहरण CSS text-indent प्रॉपर्टी को दर्शाते हैं।<!DOCTYPE html> <html> <head&g