html在搜索按钮中加放大镜,CSS3 搜索按钮动效 - 放大镜图标变叉叉

CSS

语言:

CSSSCSS

确定

body {

display: flex;

justify-content: center;

align-items: center;

height: 100vh;

background: lightslategray;

}

.search-icon {

background-color: lightslategray;

height: 2.8em;

width: 2.8em;

display: block;

padding: 0.5em;

margin: 1em auto;

position: relative;

cursor: pointer;

border-radius: 4px;

}

.circle {

position: relative;

display: block;

height: 24px;

width: 24px;

background-color: lightslategray;

border-radius: 50px;

z-index: 0;

border: 6px solid white;

transition: all 0.6s cubic-bezier(0.25, 1.7, 0.35, 0.8);

z-index: 1;

}

.handle {

position: absolute;

background-color: white;

top: 29px;

left: 6px;

width: 50px;

height: 6px;

display: block;

transform: rotate(45deg);

float: right;

border-radius: 2px;

}

.handle:after {

content: "";

background-color: white;

width: 50px;

height: 6px;

display: block;

float: right;

border-radius: 2px;

transition: all 0.6s cubic-bezier(0.25, 1.7, 0.35, 0.8);

z-index: -1;

}

.open .circle {

transform: scale(0.02);

transform-origin: 20% 20%;

background: white;

border-color: white;

}

.open .handle:after {

transform-origin: center center;

transform: rotate(90deg);

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值