Skip to main content

Make Pop Up Affect of Card Using JavaScripts | HTML And CSS | Coding With Roannie

Make Pop Up Affect of Card Using JavaScripts | HTML And CSS | Coding With Roannie



Source Code:

 <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body{
         margin0;
         padding0;
         background-color#1750eb;
         displayflex;
        justify-contentcenter;
        align-itemscenter;
        border-radius10px;
        min-height100vh;
    }
    section{
        height300px;
        width:350px;
        background-color#ffff;
        colorblack;
        
        border-radius10px;
        animation: animate 500ms linear ;
        
    }
    @keyframes animate {
        0%{
            width0px;
            height0px;
        }
        100%{
            transform:matrix3d(5deg);
        }
    }
    .container{

        padding10px ;
        margin10px;
    }
.item1{
        text-aligncenter;
        padding10px ;
        margin30px;
        font-familyVerdana, Geneva, Tahomasans-serif;
        font-sizemedium;
        font-weightbold;

}
.item2{
        text-aligncenter;
        padding1px ;
        margin2px;
        font-familyVerdana, Geneva, Tahomasans-serif;

}
.item3{
        text-aligncenter;
        padding0px ;
        margin0px;
        font-familyVerdana, Geneva, Tahomasans-serif;

}
.btn{
        positionabsolute;
        padding4px 4px 4px 4px ;
        margin4px;
        text-aligncenter;
        background-color#1750eb;
        border-radius4px;
        color#ffff;
        font-weight300;
        cursorpointer;
        top60%;
        left46%;
        border2px solid #ffff;
        font-sizelarge;

}
.x{
    positionabsolute;
    top30%;
    padding3px;
    margin3px;
    cursorpointer;
    left60%;
    font-familyArialHelveticasans-serif;
    font-sizelarge;
    
}
.show{
    cursorpointer;
    background-color:#1750eb;
    color:#1750eb;
    border1px solid royalblue;
    border-radius2px;
    font-sizesmall;
    padding4px 4px 4px 4px ;
    margin4px;
    
   text-aligncenter;
    height10px;
    width40px;
    font-familysans-serif;
    positionabsolute;
    top70%;
    left50%;

}
.show:hover{
    colorblack;
    border2px solid white;
}
img{
floatright;
displayflex;
justify-contentcenter;
align-selfcenter;
outline3px double dodgerblue;
border-radius4px;
}
.btn:hover{
    color:wheat;
    background-colorrgb(34114243);
    box-shadowinset 4px 4px 4px solid #4d4c4e;
}
</style>
<body>
    <div class="show" onclick="hide('block')">Show</div>
    <section class="section">
      <div class="x" onclick="hide('none')">X</div>
      
      <div class="container">
          <div class="item1">This Is The Pop Up Effect </div>
          
          <img src="../Downloads/macOSBigSur.jpg" width="100px" alt="">
          <div class="item2">Hey Guys I am Coder</div>
          <div class="item3">Web Developer </div>
        </div>
        <button class="btn">Learn More</button>
    </section>
    <script>
        function hide(anything){
              let btn = document.querySelector(".section")
              btn.style.display = anything 
        }
        function show(anything){
              let show = document.querySelector(".show")
              btn.style.display = anything 
        }
    </script>
</body>
</html>

Subscribe us on YouTube


Thanks for visiting