Make a Cool Card Effect in HTML and CSS

 




In this tutorial, I will show you how to make this Cool Card Clip Effect using Only HTML and CSS.

the final result will look like this



before we start coding, try to download these images because we will need them

a cool pizza image





now that you have set up your project let's start coding.


index.html

<!DOCTYPE HTML>
<html>
    <head>
    <link rel="stylesheet" href="main.css">
</head>

<body>

    <div class="card">
        <div class="card_header">
            
        </div>
        <div class="card_body">
            <h1>Cheese Pizza</h1>
            <h2>Salt Pizza</h2>
            <p>Indulge in our 11-inch chicken cheese burst pizzas. Loaded with your favorite toppings.</p>
            <span class="price">Price: 45$</span><br>
            <button>Order Now</button>
        </div>
    </div>

</body>
</html>


main.css
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500&family=Open+Sans&family=Roboto&display=swap');
*{
    margin0;
    padding0;
    outline0;
}
.card{
    width300px;
    height586px;
    box-shadowrgba(0,0,0,0.30 3px 12px;
    border-radius10px;
    overflowhidden;
    positionabsolute;
    left50%;
    top50%;
    transformtranslate(-50%,-50%);
    padding0;
}
.card_header{
    width100%;
    height50%;
    background-color#0053ff;
    background-imageurl("background.jpg");
    background-positioncenter;
    background-sizecover;
    background-repeatno-repeat;
    positionrelative;
}
.card_header::after{
    content'';
    positionabsolute;
    displayblock;
    background-imageurl(mask.png);
    left0;
    top0;
    bottom0;
    right0;
    background-sizecover;
    background-positionbottom;
    mix-blend-modescreen;
    
}

.card_body{
    padding12px;
    positionrelative;
    top-60px;
    height50%;
}
.card_body h1{
    font-family'Montserrat'sans-serif;
    margin-bottom12px;
}
.card_body h2{
    font-family:'Montserrat'sans-serif;
    font-weight200;
    font-size12px;
    text-aligncenter;
    margin-bottom18px;
    padding8px 5px;
    background-color#FF5252;
    width120px;
    color#fafafa;
    border-radius50px;
}

.card_body p{
    font-family'Open sans',sans-serif;
    font-size18px;
    margin-bottom18px;
}
.price{
    font-weight800;
    font-size26px;
    font-family'Open Sans',sans-serif;
}
.card_body button{
    padding12px 18px;
    bordernone;
    background-color#FF5252;
    color#fafafa;
    font-family'Montserrat'sans-serif;
    border-radius80px;
    positionabsolute;
    bottom-25px;
    right0;
    margin15px;
}


Make a Cool Card Effect in HTML and CSS Make a Cool Card Effect in HTML and CSS Reviewed by Medics on September 12, 2020 Rating: 5

1 comment:

-->
Powered by Blogger.