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

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;
        line-height: 150px; font-size: 30px;
        width: 100px; margin: 5px;
      }
      div { animation: myanim 4s infinite; }
      @-webkit-keyframes myanim {
        70% { flex-shrink: 1; }
      }
    </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-basis प्रॉपर्टी को एनिमेट करें

    CSS flex-basis प्रॉपर्टी (फ्लेक्स आइटम की प्रारंभिक मुख्य आकार) को एनिमेट करने के लिए @keyframes का उपयोग करें। उदाहरण <!DOCTYPE html> <html> <head> <style>    .box {       display: flex;       background-color: green;    } &

  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