html渐变按钮代码,HTML 编码风格的按钮

CSS

语言:

CSSSCSS

确定

.code-button {

display: inline-block;

font-family: "Menlo", "Bitstream Vera Sans Mono", "DejaVu Sans Mono", "Monaco", "Consolas", monospace;

margin: 1em;

background: #434d5a;

border: none;

padding: 1em 0;

color: white;

text-align: center;

text-decoration: none;

width: 9em;

-webkit-transition: all 0.2s ease, background-color 0.2s ease 0.1s, box-shadow 0.2s ease 0.1s;

transition: all 0.2s ease, background-color 0.2s ease 0.1s, box-shadow 0.2s ease 0.1s;

}

.code-button__bracket,

.code-button__text,

.code-button__code {

display: inline-block;

margin-right: -3px;

text-align: center;

width: 0.5em;

-webkit-transition: all 0.2s ease;

transition: all 0.2s ease;

}

.code-button__bracket {

font-weight: normal;

}

.code-button__text {

opacity: 0;

position: absolute;

-webkit-transition: color 0.2s ease 0.1s;

transition: color 0.2s ease 0.1s;

}

.code-button:hover {

color: #434d5a;

background-color: #aaffa9;

box-shadow: inset 15px 5px 70px -10px #aaffa9, inset -15px -5px 70px -10px #11ffbd;

padding: 1em 0;

-webkit-transition: all 0.2s ease, color 0.2s ease 0.05s;

transition: all 0.2s ease, color 0.2s ease 0.05s;

}

.code-button:hover .code-button__code,

.code-button:hover .code-button__text {

width: 2em;

}

.code-button:hover .code-button__code {

opacity: 0;

position: absolute;

}

.code-button:hover .code-button__text {

opacity: 1;

position: static;

-webkit-transition: all 0.2s ease, color 0.2s ease 0s;

transition: all 0.2s ease, color 0.2s ease 0s;

}

.code-button:hover .code-button__bracket {

-webkit-transition: all 0.2s ease, color 0.2s ease 0s;

transition: all 0.2s ease, color 0.2s ease 0s;

}

.code-button--html:hover {

background-color: #fc8f71;

box-shadow: inset 15px 15px 90px -20px #fc8f71, inset -15px -5px 80px -10px #fcdcab;

}

.code-button--js:hover {

background-color: #87e1ed;

box-shadow: inset 15px 15px 90px -20px #7996d1, inset -15px -5px 80px -10px #87e1ed;

}

body {

text-align: center;

padding: 10px;

background: #fffaf7;

}

h1 {

color: #2d343d;

font-family: "Fredoka One";

text-transform: uppercase;

font-size: 4em;

line-height: 0.7em;

}

h1 small {

opacity: 0.7;

font-family: "Comfortaa";

text-transform: none;

font-size: 0.7em;

line-height: 0.5em;

}

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值