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

CSS flex-shrink प्रॉपर्टी


फ्लेक्स आइटम सिकोड़ें

flex-shrink प्रॉपर्टी फ्लेक्स-आइटम को सिकोड़ती है।

उदाहरण

निम्न कोड में Q4 फ्लेक्स-आइटम पर flex-shrink:0 लागू किया गया है:

<!DOCTYPE html>
<html>
  <head>
    <style>
      .mycontainer {
        display: flex;
        background-color: orange;
      }
      .mycontainer > div {
        background-color: white;
        text-align: center;
        line-height: 40px;
        font-size: 25px;
        width: 100px;
        margin: 5px;
      }
    </style>
  </head>
  <body>
    <h1>Quiz</h1>
    <div class="mycontainer">
      <div>Q1</div>
      <div>Q2</div>
      <div>Q3</div>
      <div style="flex-shrink: 0">Q4</div>
      <div>Q5</div>
      <div>Q6</div>
      <div>Q7</div>
      <div>Q8</div>
      <div>Q9</div>
    </div>
  </body>
</html>

  1. - CSS flex-shrink प्रॉपर्टी पर एनिमेशन करें

    फ्लेक्स-श्रिंक एनिमेशन flex-shrink प्रॉपर्टी पर CSS एनिमेशन लागू करें: उदाहरण <!DOCTYPE html> <html> <head> <style> .mycontainer { display: flex; background-color: orange; } .mycontainer > div { background-color: white; text-align: center;

  1. CSS में चाइल्ड सिलेक्टर्स CSS में चाइल्ड सिलेक्टर्स

    चाइल्ड सिलेक्टर CSS चाइल्ड सिलेक्टर का उपयोग किसी विशेष पैरेंट एलिमेंट के सभी चाइल्ड एलिमेंट्स को सिलेक्ट करने के लिए किया जाता है। सिंटैक्स element > element { /*declarations*/ } उदाहरण 1 <!DOCTYPE html> <html> <head> <style> * { padding: 5px; } article > div { border

  1. CSS में Background Attachment CSS में Background Attachment

    CSS में background-attachment प्रॉपर्टी का उपयोग व्यूपोर्ट के सापेक्ष पेज स्क्रॉल होने पर बैकग्राउंड इमेज की स्थिति निर्दिष्ट करने के लिए किया जाता है। इसके मान scroll, fixed और local हो सकते हैं। सिंटैक्स CSS background-attachment प्रॉपर्टी का सिंटैक्स निम्नलिखित है: Selector {    backgr