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

CSS से इमेज ओवरले ज़ूम होवर इफेक्ट कैसे बनाएं?


CSS से इमेज ओवरले ज़ूम होवर इफेक्ट बनाने का कोड निम्नलिखित है:

उदाहरण

<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> .card-container {    position: relative;    width: 50%; } img {    display: block;    width: 100%; } .overlay {    position: absolute;    top:0;    bottom: 0;    left: 0;    right: 0;    background-color: rgb(55, 74, 179);    overflow: hidden;    width: 100%;    height: 0;    transform:scale(0);    transition: .5s ease-in-out; } .card-container:hover .overlay {    height: 100%;    transform: scale(1); } .caption {    color: white;    font-size: 30px;    position: absolute;    top: 50%;    left: 50%;    text-align: center; } </style> </head> <body> <h1>Image Overlay Zoom Example</h1> <div class="card-container"> <img src="https://i.picsum.photos/id/237/536/354.jpg"> <div class="overlay"> <div class="caption">Dog</div> </div> </div> </body> </html>

आउटपुट

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

CSS से इमेज ओवरले ज़ूम होवर इफेक्ट कैसे बनाएं?

इमेज पर होवर करने पर ओवरले ज़ूम होकर पूरी इमेज को कवर करेगा:

CSS से इमेज ओवरले ज़ूम होवर इफेक्ट कैसे बनाएं?


  1. CSS से स्मूथ स्क्रॉलिंग प्रभाव कैसे बनाएं? CSS से स्मूथ स्क्रॉलिंग प्रभाव कैसे बनाएं?

    CSS से स्मूथ स्क्रॉलिंग प्रभाव बनाने के लिए, कोड निम्नानुसार है -उदाहरण<!DOCTYPE html> <html> <head> <style>    html {       scroll-behavior: smooth;    }    * {       box-sizing: border-box;    }   &n

  1. CSS से होवर पर एलिमेंट को ज़ूम/स्केल कैसे करें? CSS से होवर पर एलिमेंट को ज़ूम/स्केल कैसे करें?

    CSS से होवर पर एलिमेंट को ज़ूम/स्केल करने के लिए, कोड निम्नानुसार है -उदाहरण<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1" /> <style>    * {       box-sizing: border-box; &nb

  1. CSS से पैरालैक्स स्क्रोलिंग प्रभाव कैसे बनाएं? CSS से पैरालैक्स स्क्रोलिंग प्रभाव कैसे बनाएं?

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