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

CSS से फ्लिप बॉक्स कैसे बनाएं?


CSS से फ्लिप बॉक्स बनाने के लिए, कोड निम्नानुसार है -

उदाहरण

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style>    body {       font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;       margin:20px;    }    .flipCard {       background-color: transparent;       width: 300px;       height: 300px;       perspective: 1000px;    }    .innerCard {       position: relative;       width: 100%;       height: 100%;       text-align: center;       transition: transform 0.6s;       transform-style: preserve-3d;       box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);    }    .flipCard:hover .innerCard {       transform: rotateY(180deg);    }    .frontCard, .cardBack {       position: absolute;       width: 100%;       height: 100%;       -webkit-backface-visibility: hidden;       backface-visibility: hidden;    }    .frontCard {       background-color: rgb(124, 225, 243);       color: black;    }    .cardBack {       background-color: #3329b9;       color: white;       transform: rotateY(180deg);       font-size: 18px;       font-weight: bold;    } </style> </head> <body> <h1>Flip box example</h1> <div class="flipCard"> <div class="innerCard"> <div class="frontCard"> <h1>Front Text</h1> </div> <div class="cardBack"> <h1>Back Text</h1> </div> </div> </div> <h2>Hover over the above card to see the back side</h2> </body> </html>

आउटपुट

उपरोक्त कोड निम्न आउटपुट उत्पन्न करेगा -

CSS से फ्लिप बॉक्स कैसे बनाएं?

एलिमेंट पर होवर करने पर एलिमेंट फ्लिप होगा जैसा दिखाया गया है -

CSS से फ्लिप बॉक्स कैसे बनाएं?


  1. CSS से बेसिक कार्ड कैसे बनाएं? CSS से बेसिक कार्ड कैसे बनाएं?

    बेसिक कार्ड में इमेज, नाम, पदनाम होता है। बॉक्स-शैडो, होवर पर शैडो गहरी, पदनाम बैज स्टाइल, रिस्पॉन्सिव चौड़ाई (40%, मैक्स 300px)। उदाहरण <!DOCTYPE html> <html> <head> <meta name=viewport content=width=device-width, initial-scale=1> <style> body { font-family:

  1. CSS से कूपन बनाना CSS से कूपन बनाना

    कूपन डिज़ाइन CSS से कूपन बनाने के लिए निम्न कोड उपयोग करें: उदाहरण <!DOCTYPE html> <html> <head> <meta name=viewport content=width=device-width, initial-scale=1 /> <style> body { font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif; } img { width: 100%; } .coupon

  1. CSS से तीर कैसे बनाएं? CSS से तीर कैसे बनाएं?

    CSS से तीर बनाने के लिए, कोड निम्नानुसार है -उदाहरण<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    body {       font-family: "Segoe UI", Tahoma, Geneva