CSS:hover效果代码

视频来源CSS 让人惊艳的hover效果!_哔哩哔哩_bilibili

转载自:  https://youtu.be/a7PHhF5Vw5wicon-default.png?t=M1L8https://youtu.be/a7PHhF5Vw5w

<!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>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css">
</head>
<style>
    body{
        margin: 0;
        padding: 0;
        background-color: #0a3d62;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }
    a{
        margin: 0 20px;
        width: 80px;
        height:  80px;
        background-color: #ccc;
        display: inline-block;
        border-radius: 24px;
        box-shadow: 6px 6px 12px rgba(0, 0, 0, 15),
        -6px -6px 12px rgba(255, 255, 255, .1);
        overflow: hidden;
        font-size: 28px;
        transition: .3s linear;
        position: relative;
    }
    a:hover{
        transform: scale(1.3);
        border-radius: 50%;
    }
    a i::before{
        position: absolute;
        width: 100%;
        height: 100%;
        text-align: center;
        background-size: 200% 200%;
        background-position: 75% 75%;
        top: 0;
        left: 0;
        line-height: 80px;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        transition: background .5s linear;
    }
    a:hover i::before{
        background-position: 0% 0%;
    }
    .fa-facebook-f::before{
        background-image: linear-gradient(135deg,#3b5998 30%,#0a3d62 50%);
    }
    .fa-twitter::before{
        background-image: linear-gradient(135deg,#1da1f2 30%,#0a3d62 50%);
    }
    .fa-instagram::before{
        background-image: linear-gradient(135deg,#c32aa3 30%,#0a3d62 50%);
    }
    .fa-youtube::before{
        background-image: linear-gradient(135deg,#d71e18 30%,#0a3d62 50%);
    }
    
</style>
<body>
    <div class="sm">
        <a href="#"><i class="fab fa-facebook-f"></i></a>
        <a href="#"><i class="fab fa-twitter"></i></a>
        <a href="#"><i class="fab fa-instagram"></i></a>
        <a href="#"><i class="fab fa-youtube"></i></a>
        
    </div>
</body>
</html>

        第一次看到这个视频有被花里胡哨的效果惊艳到,值得学习参考,在此将代码贴上。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Coolstuz

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值