推荐一个CSS3卡片hover动画效果

[复制链接]
七夏(UID:1) 发表于 2025-1-2 17:42:51 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×

图片

<!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 {
    padding: 200px;
    background-color: #000;
  }
  .cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }
  .cards .red {
    background-color: #f43f5e;
  }
  .cards .blue {
    background-color: #3b82f6;
  }
  .cards .green {
    background-color: #22c55e;
  }
  .cards .card {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    height: 100px;
    width: 250px;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: 400ms;
  }
  .cards .card p.tip {
    font-size: 1em;
    font-weight: 700;
  }
  .cards .card p.second-text {
    font-size: .7em;
  }
  .cards .card:hover {
    transform: scale(1.1, 1.1);
  }
  .cards:hover>.card:not(:hover) {
    filter: blur(10px);
    transform: scale(0.9, 0.9);
  }
</style>
<body>
  <div class="cards">
    <div class="card red">
      <p class="tip">Hover Me</p>
      <p class="second-text">Lorem Ipsum</p>
    </div>
    <div class="card blue">
      <p class="tip">Hover Me</p>
      <p class="second-text">Lorem Ipsum</p>
    </div>
    <div class="card green">
      <p class="tip">Hover Me</p>
      <p class="second-text">Lorem Ipsum</p>
    </div>
  </div>
</body>
</html>
小时候,看腻了农村的牛和马,长大后,来到了城里,才知道原来到处都是牛马!
全部回复1 显示全部楼层
huakhl(UID:94) 发表于 2025-1-3 09:28:42 | 显示全部楼层
多谢分享哦

快速回帖

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1楼
2楼

关于楼主

管理员
  • 主题

    1072
  • 回答

    437
  • 积分

    2970
虚位以待,此位置招租
虚位以待,此位置招租

商务推广

    此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租 此位置招租
最新热评 加载中...