cards website

by roshan100kar

HTML

<!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">
    <link rel="stylesheet" href="style.css">
    <title>Expanding card </title>
</head>
<body>
    <div class="container">
        <div class="panel active" style="background-image: url('https://images.unsplash.com/photo-1575790381415-fdbc96607058?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=435&q=80') "> 
            <h3>Explore The World</h3>  
        </div>

        <div class="panel active" style="background-image: url('https://images.unsplash.com/photo-1587922546307-776227941871?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=774&q=80') "> 
            <h3>Sunny Beach</h3>  
        </div>

        <div class="panel active" style="background-image: url('https://images.unsplash.com/photo-1605866980848-6efe102261ab?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=464&q=80') "> 
            <h3>City on winter</h3>  
        </div>

        <div class="panel active" style="background-image: url('https://images.unsplash.com/photo-1487811566627-ecd6321dfd2b?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8aW5kaWFufGVufDB8fDB8fA%3D%3D&auto=format&fit=crop&w=500&q=60') "> 
            <h3>Longing for lullaby</h3>  
        </div>

        <div class="panel active" style="background-image: url('https://images.unsplash.com/photo-1602859694543-4a31903edcaf?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1yZWxhdGVkfDZ8fHxlbnwwfHx8fA%3D%3D&auto=format&fit=crop&w=400&q=60') "> 
            <h3>Take a Ride 🐱‍🏍</h3>  
        </div>   
       
    </div>
  
</body>
</html>

CSS

*{
    box-sizing: border-box;
}
body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    margin: 0;
}

.container {
    display: flex;
    width: 90vw;
}
.panel {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 80vh;
    border-radius: 50px;
    color: #ffff;
    cursor: pointer;
    flex: 0.5;
    margin: 10px;
    position: relative;
}
.panel h3 {
    font-size: 24px;
    position: absolute;
    bottom: 20px;
    left: 20px;
    margin: 0;
    opacity: 0;

} 
.panel.active {
    flex: 5;
}
.panel.active h3 {
    opacity: 1; 
}
@media(max-width: 480px) {
    .c ontainer {
        width : 100vw;
    }
    .panel:nth-of-type(3),
    .panel:nth-of-type(4) {
     display: none;
    }
}