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

CSS order प्रॉपर्टी


फ्लेक्स आइटम्स का क्रम बदलें

order प्रॉपर्टी का उपयोग फ्लेक्स आइटम्स का क्रम सेट करने के लिए करें।

उदाहरण

<!DOCTYPE html>
<html>
  <head>
    <style>
      .mycontainer {
        display: flex;
        background-color: orange;
        align-content: space-between;
        height: 150px;
        width: 600px;
        flex-wrap: wrap;
      }
      .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 style="order: 8">Q1</div>
      <div style="order: 6">Q2</div>
      <div style="order: 2">Q3</div>
      <div style="order: 1">Q4</div>
      <div style="order: 7">Q5</div>
      <div style="order: 4">Q6</div>
      <div style="order: 3">Q7</div>
      <div style="order: 5">Q8</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 order प्रॉपर्टी को एनिमेट करें

    CSS में order प्रॉपर्टी पर एनिमेशन लागू करने का तरीका यहां दिखाया गया है। यह फ्लेक्स कंटेनर में आइटम्स के क्रम को बदलता है। उदाहरण <!DOCTYPE html> <html> <head> <style> #demo1 { width: 600px; height: 180px; display: flex; }

  1. CSS isolation प्रॉपर्टी CSS isolation प्रॉपर्टी

    isolation प्रॉपर्टी का उपयोग यह परिभाषित करने के लिए किया जाता है कि कोई तत्व एक नया स्टैकिंग संदर्भ बनाएगा या नहीं। सिंटैक्स isolation: auto | isolate | initial | inherit; उदाहरण <!DOCTYPE html> <html> <head> <style> .demo1 { background-color: orange; }