HTML 및 CSS만 사용하는 반응형 애니메이션 카드 디자인
                                            
                                                
                                                
                                                
                                                
                                                
                                                 7592 단어  javascriptincodercsshtml
                    
이 디자인[반응형 애니메이션 카드 디자인]에는 위 이미지에서 볼 수 있듯이 3개의 제품 카드가 있습니다. 카드 위로 마우스를 가져가면 부드럽게 전환되고 상자 그림자도 증가합니다. 우선 카드 상단에 제품 이미지가 있고 그 다음에는 제품명이 있고 그 뒤에는 제품 설명이 있고 마지막으로 지금 구매하기 버튼이 있습니다.
내가 말하려는 내용을 이해하기 어렵다면 소스 코드를 확인하고 미리보기도 할 수 있습니다.
미리보기를 확인하려면 here을 방문하세요.
HTML 코드
<!-- ------------------- Created By InCoder ------------------- -->
<!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>Animated Product Card Design - InCoder</title>
    <link rel="stylesheet" href="main.css">
</head>
<body>
    <div class="productContainer">
        <div class="card">
            <div class="header" style="height: 17rem;">
                <img src="https://drive.google.com/uc?id=1p-U1HYQRRFKAEDC4JzSqps4YWtpQ8_Pc&export=view" alt="Product">
            </div>
            <div class="footer">
                <div class="title">
                    <h2>Smart Watch</h2>
                </div>
                <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eaque ratione tempore consequuntur voluptatem obcaecati asperiores est iusto.</p>
                <button class="buyNow">Buy Now</button>
            </div>
        </div>
        <div class="card">
            <div class="header" style="height: 17rem;">
                <img src="https://drive.google.com/uc?id=19w5IpBg45HXZsUc2cYF-LsyDcoxs_aLZ&export=view" alt="Product">
            </div>
            <div class="footer">
                <div class="title">
                    <h2>IPhone 13 Pro</h2>
                </div>
                <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eaque ratione tempore consequuntur voluptatem obcaecati asperiores est iusto.</p>
                <button class="buyNow">Buy Now</button>
            </div>
        </div>
        <div class="card">
            <div class="header" style="height: 17rem;">
                <img src="https://drive.google.com/uc?id=1fkkvLxXRjMTCCtLwUZmWXlKOBOYd3IbM&export=view" alt="Product">
            </div>
            <div class="footer">
                <div class="title">
                    <h2>Sports Shoe</h2>
                </div>
                <p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Eaque ratione tempore consequuntur voluptatem obcaecati asperiores est iusto.</p>
                <button class="buyNow">Buy Now</button>
            </div>
        </div>
    </div>
</body>
</html>
CSS 코드
/* ------------------- Created By InCoder ------------------- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
}
.productContainer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}
.card {
    height: auto;
    overflow: hidden;
    max-width: 22rem;
    border-radius: 1rem;
    margin: 1rem 2rem;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.5s, box-shadow 0.5s;
    box-shadow: 0px 0px 20px 1px rgb(204 204 204 / 50%);
}
.card:hover {
    transform: translateY(-15px);
    box-shadow: 0px 10px 20px 0px rgb(204 204 204 / 50%);
}
.card .header {
    z-index: 2;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    background-color: #ff0;
    border-radius: 0rem 0rem 4rem 0rem;
}
.card .header::before {
    content: "";
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    position: absolute;
    border-radius: 0rem 0rem 4rem 0rem;
}
.card .header img {
    width: 85%;
}
.card .footer {
    z-index: 2;
    text-align: center;
    position: relative;
    padding: 20px 20px 20px 20px;
}
.card .footer::before {
    content: "";
    top: 0;
    left: 0;
    width: 100%;
    z-index: -1;
    height: 100%;
    position: absolute;
    background-color: #fff;
    border-radius: 3rem 0rem 0rem 0rem;
}
.card .footer .title {
    font-size: 1.4rem;
    margin-bottom: .4rem;
}
.card .footer p {
    font-size: .8rem;
}
.productContainer .card:nth-child(2) .header img {
    width: 120%;
}
.productContainer .card:nth-child(3) .header img {
    width: 120%;
}
.productContainer .card:nth-child(1) .header::before {
    background-image: linear-gradient(to bottom, #2f354d, #23252c);
}
.productContainer .card:nth-child(1) .footer {
    background: #23252c;
}
.productContainer .card:nth-child(2) .header::before {
    background-image: linear-gradient(to bottom, #01408f, #011842);
}
.productContainer .card:nth-child(2) .footer {
    background: #011842;
}
.productContainer .card:nth-child(3) .header::before {
    background-image: linear-gradient(to bottom, #e93632, #501823);
}
.productContainer .card:nth-child(3) .footer {
    background: #501823;
}
.buyNow {
    cursor: pointer;
    margin-top: 1rem;
    font-size: 1rem;
    border-radius: 5rem;
    padding: .6rem 2rem;
    background-color: #fff;
    transition: all .2s ease-in-out;
}
.productContainer .card:nth-child(1) .buyNow {
    color: #2f354d;
    border: 2px solid #2f354d;
}
.productContainer .card:nth-child(1) .buyNow:hover {
    color: #fff;
    background-color: #2f354d;
}
.productContainer .card:nth-child(2) .buyNow {
    color: #01408f;
    border: 2px solid #01408f;
}
.productContainer .card:nth-child(2) .buyNow:hover {
    color: #fff;
    background-color: #01408f;
}
.productContainer .card:nth-child(3) .buyNow {
    color: #e93632;
    border: 2px solid #e93632;
}
.productContainer .card:nth-child(3) .buyNow:hover {
    color: #fff;
    background-color: #e93632;
}
@media (max-width: 1248px) {
    .productContainer {
        margin-top: 29rem;
    }
}
@media (max-width: 832px) {
    .productContainer:nth-child(1) {
        margin-top: 92rem;
    }
}
                Reference
이 문제에 관하여(HTML 및 CSS만 사용하는 반응형 애니메이션 카드 디자인), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://dev.to/incoderweb/responsive-animated-card-design-using-html-and-css-only-jap텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
                                
                                
                                
                                
                                
                                우수한 개발자 콘텐츠 발견에 전념
                                (Collection and Share based on the CC Protocol.)