html css 圆形按钮 仿uc,一个简单的CSS3社交分享圆形按钮悬停动效

本文介绍如何使用CSS3实现动态的社交图标,通过`rgba()`背景色和`linear-gradient()`渐变效果,以及hover状态下的缩放和颜色变化。同时展示了`.social-square`特性的旋转效果。
摘要由CSDN通过智能技术生成

CSS

语言:

CSSSCSS

确定

body {

background-color: rgba(29, 161, 242, 0.05);

}

.social-container {

width: 400px;

margin: 40vh auto;

text-align: center;

}

.social-icons {

padding: 0;

list-style: none;

margin: 1em;

}

.social-icons li {

display: inline-block;

margin: 0.15em;

position: relative;

font-size: 1.2em;

}

.social-icons i {

color: #fff;

position: absolute;

top: 21px;

left: 21px;

transition: all 265ms ease-out;

}

.social-icons a {

display: inline-block;

}

.social-icons a:before {

transform: scale(1);

-ms-transform: scale(1);

-webkit-transform: scale(1);

content: " ";

width: 60px;

height: 60px;

border-radius: 100%;

display: block;

background: linear-gradient(45deg, #1DA1F2, #c648c8);

transition: all 265ms ease-out;

}

.social-icons a:hover:before {

transform: scale(0);

transition: all 265ms ease-in;

}

.social-icons a:hover i {

transform: scale(2.2);

-ms-transform: scale(2.2);

-webkit-transform: scale(2.2);

color: #1DA1F2;

background: -webkit-linear-gradient(45deg, #1DA1F2, #c648c8);

-webkit-background-clip: text;

-webkit-text-fill-color: transparent;

transition: all 265ms ease-in;

}

.social-icons a.social-square:before {

background: linear-gradient(45deg, #7b00e0, #ae31d9);

border-radius: 10%;

}

.social-icons a.social-square:hover:before {

transform: rotate(-180deg);

-ms-transform: rotate(-180deg);

-webkit-transform: scale(-180deg);

border-radius: 100%;

}

.social-icons a.social-square:hover i {

transform: scale(1.6);

-ms-transform: scale(1.6);

-webkit-transform: scale(1.6);

color: #fff;

transform: scale(1.6);

-webkit-text-fill-color: #fff;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值