之前为大家分享了推荐10款纯css3实现的实用按钮,今天给大家带来一款纯css3实现的颜色渐变按钮。这款按钮的边框和文字的颜色通过css3实现两种颜色的渐变,效果非常好看,一起看下效果图:

在线预览   源码下载

实现的代码。

html代码:

 <div class="container">
<a target="_blank" class="btn green" href="http://www.w2bc.com/"><span>Nominate Yourself</span></a>
<a target="_blank" class="btn orange" href="http://www.w2bc.com/"><span>Nominate Someone</span></a>
<a target="_blank" class="btn blue" href="http://www.w2bc.com/"><span>Buy Tickets Now</span></a>
</div>

css3代码:

  .btn
{
display: inline-block;
margin: 1em 0;
padding: 1em 2em;
background: transparent;
border: 2px;
border-radius: 3px;
font-weight:;
text-align: center;
}
.btn.green
{
box-shadow: 0 1px 0 1px rgba(43, 220, 146, 0.25), 0 -1px 0 1px rgba(129, 214, 106, 0.25), 1px 0 0 1px rgba(43, 220, 146, 0.25), -1px 0 0 1px rgba(129, 214, 106, 0.25), 1px -1px 0 1px rgba(86, 217, 126, 0.5), -1px 1px 0 1px rgba(86, 217, 126, 0.5), 1px 1px 0 1px rgba(0, 223, 166, 0.75), -1px -1px 0 1px rgba(173, 211, 86, 0.75);
}
.btn.green span
{
background: -webkit-linear-gradient(left, #add356, #00dfa6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.btn.orange
{
box-shadow: 0 1px 0 1px rgba(255, 102, 43, 0.25), 0 -1px 0 1px rgba(255, 169, 69, 0.25), 1px 0 0 1px rgba(255, 102, 43, 0.25), -1px 0 0 1px rgba(255, 169, 69, 0.25), 1px -1px 0 1px rgba(255, 136, 56, 0.5), -1px 1px 0 1px rgba(255, 136, 56, 0.5), 1px 1px 0 1px rgba(255, 69, 31, 0.75), -1px -1px 0 1px rgba(255, 203, 82, 0.75);
}
.btn.orange span
{
background: -webkit-linear-gradient(left, #ffcb52, #ff451f);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.btn.blue
{
-webkit-border-image: -webkit-linear-gradient(left, #3dade9, #bf2fcb) round;
border-image-slice:;
}
.btn.blue span
{
background: -webkit-linear-gradient(left, #3dade9, #bf2fcb);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.btn:nth-of-type(1)
{
float: left;
}
.btn:nth-of-type(2)
{
float: right;
}
.btn:nth-of-type(3)
{
width: 100%;
clear: left;
padding: .75em;
font-size: 3em;
font-weight:;
line-height:;
letter-spacing: 1px;
} *
{
-moz-box-sizing: border-box;
box-sizing: border-box;
} body
{
font: normal 1em 'Helvetica Neue' , Helvetica, sans-serif;
background: #1d2025;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
} .container
{
width: 60%;
margin: auto;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.container:after
{
display: table;
content: '';
clear: both;
} a
{
color: inherit;
text-decoration: none;
} h1.method1
{
background: -webkit-linear-gradient(left, #ef0, #f00);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}

注:本文爱编程原创文章,转载请注明原文地址:http://www.w2bc.com/Article/10449

最新文章

  1. MongoDB学习笔记~客户端命令行的使用
  2. [Centos]升级安装GCC
  3. 大叔也说Xamarin~Android篇~日志的记录
  4. javascript简单的认识下return语句+2015的总结+2016的展望
  5. SVN代码的回滚二
  6. [办公自动化]skydrive onedrive
  7. LINUX DIFF命令详解
  8. Lombok - 消除冗长的 java 代码
  9. C++中构造函数和析构函数调用的时机
  10. android连续点击两次返回键退出代码
  11. 关于用自带摄像机录像无法捕获uri 问题解决
  12. Next Greater Element I
  13. linux脚本定时备份数据库表(详解)
  14. 从初识Maven到使用Maven进行依赖管理和项目构建
  15. jenkins添加类ubuntu/centos节点报错
  16. Linux平台 Oracle 18c RAC安装Part3:DB配置
  17. Disrunptor多生产者多消费者模型讲解
  18. Go基础知识
  19. UIButton使用方法汇总
  20. 怎样用MathType输入带分数

热门文章

  1. LRM-00109-ORACLE启动报错
  2. leetcode || 58、Length of Last Word
  3. velocity入门
  4. Oracle自治事务实际用例
  5. 介绍一款chrom浏览器插件 DHC是一款使用chrome模拟REST客户端向服务器发送测试数据的谷歌浏览器插件
  6. Apache Storm使用
  7. CFS调度器
  8. VC获得window操作系统版本号, 获取操作系统位数
  9. ASP.NET自定义Web服务器控件-DropDownList/Select下拉列表控件
  10. html 优化 简谈