实现流光色彩

<a href="#">sunbutton</a>

css ————————————————————————————————————————————————————————————————————————————————————————————————————————————————

a{ /*去掉下划线*/
text-decoration: none;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%,-50%);
/* 设置字体大小 */
font-size: 24px;
background: linear-gradient(90deg,#03a9f4,#f441a5,#ffeb3b,#03a9f4);
background-size: 400%;
width: 400px;
height: 100px;
line-height: 100px;
text-align: center;
color: #fff;
/* 字母变大写 */
text-transform: uppercase;
/* 设置成胶囊状 */
border-radius: 50px;
z-index: 1;
}
/* 设置发光 */
a::before{
content: "";
position: absolute;
left: -5px;
right: -5px;
top: -5px;
bottom: -5px;
background: linear-gradient(90deg,#03a9f4,#f441a5,#ffeb3b,#03a9f4);
background-size: 400%;
border-radius: 50px;
filter: blur(20px);
z-index: -1;
}
a:hover::before{
animation: sun 8s infinite;
}
a:hover{
animation: sun 8s infinite;
}
/* 设置流光 */
@keyframes sun{
100%{
background-position: -400% 0;
}
}
posted @   牛牛——  阅读(42)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
历史上的今天:
2021-04-06 vue项目npm run serve启动后修改代码报错Failed to compile with 1 errors
点击右上角即可分享
微信分享提示