Card hover with background blur


card

Card with blur effect.

<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8">
    <title>Card Hover Effects</title>
    <link rel="stylesheet" href="style.css">
    <style type="text/css">
    @import url('https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800&display=swap');
*
{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}
body
{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(0deg,#fff 50%, #2196F3);
}
.container
{
    max-width: 1000px;
    position: relative;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    transition: 0.5s;
}
.container:hover .card
{
    filter: blur(5px);
    transform: scale(.7);
}
.container .card
{
    position: relative;
    width: 250px;
    height: 300px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.5s;

}
.container .card:hover
{
    filter: blur(0px);
    transform: scale(1);
}
.container .card:before
{
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 1;
    transition: 0.5s;
}
.container .card:hover:before
{
    background: #000;
    transform: scaleY(1.15);
    box-shadow: 0 5px 15px rgba(0,0,0,.2);
}
.container .card:after
{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    transition: 0.5s;
    background: rgba(255,255,255,.1);
    z-index: 1;
}
.container .card:hover:after
{
    transform: scaleY(1.15);
}
.container .card:hover
{
    z-index: 1;
}
.container .card .content
{
    text-align: center;
    z-index: 2;
    padding: 0 20px;
    transition: 0.5s;
}
.container .card:hover .content
{
    color: #fff;
}
.container .card .content h2
{
    font-size: 3em;
}
.container .card .content p
{
    font-size: 0.9em;
}
.container .card .content a
{
    display: inline-block;
    margin-top: 15px;
    padding: 5px 10px;
    background: #262626;
    color: #fff;
    text-decoration: none;
}
.container .card:hover .content a
{
    background: #2196F3;
}
    </style>
</head>
<body>
<div class="container">
<div class="card">
<div class="content">
<h2>1</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<a href="#">Read More</a>
</div>
</div>
<div class="card">
<div class="content">
<h2>2</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<a href="#">Read More</a>
</div>
</div>
<div class="card">
<div class="content">
<h2>3</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<a href="#">Read More</a>
</div>
</div>
<div class="card">
<div class="content">
<h2>4</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<a href="#">Read More</a>
</div>
</div>
</div>
</body>
</html>

Comments