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

CSS column-fill प्रॉपर्टी से कॉलम भरने का तरीका नियंत्रित करें

CSS column-fill प्रॉपर्टी मल्टी-कॉलम लेआउट में कंटेंट को कॉलम में कैसे वितरित/भरा जाता है, इसे नियंत्रित करती है। यह तब लागू होती है जब कंटेनर की ऊंचाई निर्दिष्ट हो (ताकि कॉलम की ऊंचाई सीमित हो)।

उदाहरण

नीचे दिए गए उदाहरण में, column-fill: balance का उपयोग करके कंटेंट को 4 कॉलम में यथासंभव समान रूप से वितरित किया गया है।

<!DOCTYPE html>
<html>
<head>
  <style>
    .demo {
      column-count: 4;
      column-fill: balance;
    }
  </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.
  </div>
</body>
</html>

column-fill के मान:

  • balance (डिफ़ॉल्ट): कंटेंट को सभी कॉलम में यथासंभव समान ऊंचाई में वितरित करता है
  • auto: कंटेंट को क्रमिक रूप से भरता है (पहला कॉलम भरता है, फिर दूसरा, आदि); कॉलम ऊंचाई असमान हो सकती है
  • balance-all (नया): फ्रैगमेंटेड कॉन्टेक्स्ट (पेजिनेटेड मीडिया) में सभी पेज/कॉलम में बैलेंस करता है

पूर्वापेक्षा: कंटेनर पर निश्चित ऊंचाई (height, max-height) या पेजिनेटेड मीडिया (प्रिंट) होना चाहिए।

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

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

  1. CSS से टेक्स्ट बटन कैसे स्टाइल करें? CSS से टेक्स्ट बटन कैसे स्टाइल करें?

    CSS का उपयोग करके विभिन्न रंगों और शैलियों के टेक्स्ट बटन बनाए जा सकते हैं। इस उदाहरण में पांच अलग-अलग प्रकार के बटन (Success, Info, Warning, Danger, Default) दिखाए गए हैं जिनमें होवर इफेक्ट भी शामिल है। उदाहरण <!DOCTYPE html> <html> <head> <meta name=viewport content=width=

  1. CSS से ग्लोइंग टेक्स्ट कैसे बनाएं? CSS से ग्लोइंग टेक्स्ट कैसे बनाएं?

    CSS से ग्लोइंग टेक्स्ट बनाने के लिए, कोड निम्नानुसार है -उदाहरण<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style>    body {       background-color: rgb(0, 0, 0);