html5放大效果代码,HTML5具有悬停放大效果的魔法棒

CSS

语言:

CSSSCSS

确定

@import url("https://fonts.googleapis.com/css?family=Roboto");

body {

display: -webkit-box;

display: -ms-flexbox;

display: flex;

-webkit-box-align: center;

-ms-flex-align: center;

align-items: center;

-webkit-box-pack: center;

-ms-flex-pack: center;

justify-content: center;

min-height: 100vh;

font-family: 'Roboto', sans-serif;

-webkit-font-smoothing: antialiased;

-moz-osx-font-smoothing: grayscale;

}

.box {

-webkit-box-flex: 0;

-ms-flex: 0 0 auto;

flex: 0 0 auto;

position: relative;

margin: 0 1em;

padding: 150px 3em 3em;

width: 300px;

overflow: hidden;

box-shadow: 0 2px 4px transparent;

-webkit-transition: box-shadow ease 1s;

transition: box-shadow ease 1s;

}

.box:hover {

box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);

-webkit-transition-delay: .2s;

transition-delay: .2s;

}

.box__circle,

.box__icon {

position: absolute;

top: calc(50% - 2.5em);

left: calc(50% - 2.5em);

width: 5em;

height: 5em;

-webkit-transition: -webkit-transform ease 1s;

transition: -webkit-transform ease 1s;

transition: transform ease 1s;

transition: transform ease 1s, -webkit-transform ease 1s;

-webkit-transition-delay: .2s;

transition-delay: .2s;

will-change: transform;

}

.box__icon {

display: -webkit-box;

display: -ms-flexbox;

display: flex;

-webkit-box-pack: center;

-ms-flex-pack: center;

justify-content: center;

-webkit-box-align: center;

-ms-flex-align: center;

align-items: center;

}

.box:hover .box__icon {

-webkit-transform: translateY(-95px);

transform: translateY(-95px);

}

.box__circle {

border-radius: 100%;

}

.box__circle--blue {

background: -webkit-linear-gradient(#3170c7, #38bed3);

background: linear-gradient(#3170c7, #38bed3);

}

.box__circle--violet {

background: -webkit-linear-gradient(#6e18ca, #c32d83);

background: linear-gradient(#6e18ca, #c32d83);

}

.box__circle--purple {

background: -webkit-linear-gradient(#7f38d3, #7ec3d1);

background: linear-gradient(#7f38d3, #7ec3d1);

}

.box:hover .box__circle {

-webkit-transform: translateY(-200px) scale(14);

transform: translateY(-200px) scale(14);

}

.box__headline {

margin: 0 0 1em;

font-weight: 400;

font-size: 1.6em;

}

.box__text {

margin: 0;

line-height: 1.5;

}

.box__headline,

.box__text {

position: relative;

color: white;

opacity: 0;

-webkit-transition: opacity ease 1s;

transition: opacity ease 1s;

will-change: opacity;

}

.box:hover .box__headline,

.box:hover .box__text {

opacity: 1;

-webkit-transition-delay: .4s;

transition-delay: .4s;

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值