css动画浮动,CSS3按钮悬停背景浮动动画

CSS

语言:

CSSSCSS

确定

*, *:before, *:after {

margin: 0;

padding: 0;

-webkit-box-sizing: border-box;

-moz-box-sizing: border-box;

box-sizing: border-box; }

body {

padding-top: 10%;

text-align: center; }

.btn-split {

position: relative;

display: inline-block;

padding: 0 2rem;

font-family: 'Titillium Web', sans-serif;

font-weight: 700;

text-decoration: none;

font-size: 3rem;

line-height: 4.5rem;

color: #333;

background-image: -webkit-gradient(linear, left top, left bottom, from(tomato), to(tomato));

background-image: -webkit-linear-gradient(tomato, tomato);

background-image: linear-gradient(tomato, tomato);

-webkit-background-size: 100%;

background-size: 100%;

border-bottom: 5px solid tomato; }

.btn-split:before {

content: attr(name);

position: absolute;

top: 0;

left: 0;

width: 100%;

height: 100%;

overflow: hidden;

background-image: -webkit-gradient(linear, left top, left bottom, from(#333), to(#333));

background-image: -webkit-linear-gradient(#333, #333);

background-image: linear-gradient(#333, #333);

-webkit-background-size: 100%;

background-size: 100%;

color: white;

-webkit-transition: all 0.5s;

transition: all 0.5s; }

.btn-split:hover:before {

height: 5px; }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值