css3 按钮 利用css3实现超酷下载按钮


Posted in HTML / CSS onMarch 18, 2013

效果图如下:
css3 按钮 利用css3实现超酷下载按钮
代码如下:

复制代码
代码如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Live Preview</title>
<style>
body {
padding: 20px;
background: black;
}
div.container {
position: relative;
background: #1f1f1f;
margin: 0 auto;
width: 500px;
height: 100px;
padding: 120px 0px;
/* border-radius */
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
/* box-shadow */
-webkit-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
-moz-box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
box-shadow: rgba(0,0,0,0.2) 0px 1px 3px;
text-align: center;
}
a.button {
position: relative;
height: 15px;
padding: 12px 20px 15px 68px;
cursor: pointer;
text-align: Right;
font-weight: bold;
font-size: 18px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 2px 2px 2px 0 rgba(0,0,0,.3);
-moz-box-shadow: 2px 2px 2px 0 rgba(0,0,0,.3);
box-shadow: 2px 2px 2px 0 rgba(0,0,0,.3);
display: inline-block !important;
font: 700 15px 'Arial', Helvetica, Clean, sans-serif;
margin: 0px 0px 20px 10px;
position: relative;
text-decoration: none;
transition: background-position .2s ease, margin .1s ease;
-webkit-transition: background-position .2s ease, margin .1s ease;
-moz-transition: background-position .2s ease, margin .1s ease;
background-repeat: repeat-x;
}
a.button:hover { background-position: 0 10px }
a.button:active {
-webkit-box-shadow: -1px -1px 2px 0 rgba(0,0,0,.3);
-moz-box-shadow: -1px -1px 2px 0 rgba(0,0,0,.3);
box-shadow: -1px -1px 2px 0 rgba(0,0,0,.3);
margin: 2px 0 20px 10px;
}
a.button span.bar {
width: 1px;
height: 30px;
position: absolute;
background: black;
top: 5px;
left: 50px;
}
a.button div.arrow {
position: absolute;
left: 20px;
top: 14px;
}
a.button div.arrow span.top {
position: absolute;
width: 6px;
height: 9px;
background: #000;
top: 0;
left: 3px;
}
a.button div.arrow span.bottom,
div.arrow span.bottomShadow {
position: absolute;
width: 0px;
height: 0px;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
border-top: 8px solid black;
top: 9px;
left: -2px;
z-index: 2;
}
a.button div.arrow span.bottomShadow {
z-index: 1;
left: -1px;
}
/* GRAY
================================================== */
a.grey {
background-color: #888;
background-image: -webkit-linear-gradient(top, #888, #333);
background-image: -moz-linear-gradient(top, #888, #333);
background-image: -ms-linear-gradient(top, #888, #333);
background-image: -o-linear-gradient(top, #888, #333);
background-image: linear-gradient(top, #888, #333);
text-shadow: 1px 1px 1px rgba(255,255,255,.2);
border-top: 1px solid #aaa;
}
a.grey span.bar {
-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,.2);
-moz-box-shadow: 1px 1px 1px rgba(255,255,255,.2);
box-shadow: 1px 1px 1px rgba(255,255,255,.2);
}
a.grey div.arrow span.top {
-webkit-box-shadow: 1px 1px 1px rgba(255,255,255,.2);
-moz-box-shadow: 1px 1px 1px rgba(255,255,255,.2);
box-shadow: 1px 1px 1px rgba(255,255,255,.2);
}
a.grey div.arrow span.bottomShadow { border-top: 8px solid rgba(255, 255, 255, 0.2) }
/* BLUE
================================================== */
a.blue {
background-color: #00aeef;
background-image: -webkit-linear-gradient(top, #00aeef, #00587a);
background-image: -moz-linear-gradient(top, #00aeef, #00587a);
background-image: -ms-linear-gradient(top, #00aeef, #00587a);
background-image: -o-linear-gradient(top, #00aeef, #00587a);
background-image: linear-gradient(top, #00aeef, #00587a);
text-shadow: 1px 1px 1px #23aaff;
border-top: 1px solid #23ccff;
}
a.blue span.bar {
-webkit-box-shadow: 1px 1px 1px #23aaff;
-moz-box-shadow: 1px 1px 1px #23aaff;
box-shadow: 1px 1px 1px #23aaff;
}
a.blue div.arrow span.top {
-webkit-box-shadow: 1px 1px 1px #23aaff;
-moz-box-shadow: 1px 1px 1px #23aaff;
box-shadow: 1px 1px 1px #23aaff;
}
a.blue div.arrow span.bottomShadow { border-top: 8px solid #23aaff }
/* GREEN
================================================== */
a.green {
background-color: #68c800;
background-image: -webkit-linear-gradient(top, #68c800, #367100);
background-image: -moz-linear-gradient(top, #68c800, #367100);
background-image: -ms-linear-gradient(top, #68c800, #367100);
background-image: -o-linear-gradient(top, #68c800, #367100);
background-image: linear-gradient(top, #68c800, #367100);
text-shadow: 1px 1px 1px #67c800;
border-top: 1px solid #67e800;
}
a.green span.bar {
-webkit-box-shadow: 1px 1px 1px #67c800;
-moz-box-shadow: 1px 1px 1px #67c800;
box-shadow: 1px 1px 1px #67c800;
}
a.green div.arrow span.top {
-webkit-box-shadow: 1px 1px 1px #67c800;
-moz-box-shadow: 1px 1px 1px #67c800;
box-shadow: 1px 1px 1px #67c800;
}
a.green div.arrow span.bottomShadow { border-top: 8px solid #67c800 }
/* RED
================================================== */
a.red {
background-color: #ee5f5b;
background-image: -webkit-linear-gradient(top, #ee5f5b, #973431);
background-image: -moz-linear-gradient(top, #ee5f5b, #973431);
background-image: -ms-linear-gradient(top, #ee5f5b, #973431);
background-image: -o-linear-gradient(top, #ee5f5b, #973431);
background-image: linear-gradient(top, #ee5f5b, #973431);
text-shadow: 1px 1px 1px #ed5d69;
border-top: 1px solid #ed8d69;
}
a.red span.bar {
-webkit-box-shadow: 1px 1px 1px #ed5d69;
-moz-box-shadow: 1px 1px 1px #ed5d69;
box-shadow: 1px 1px 1px #ed5d69;
}
a.red div.arrow span.top {
-webkit-box-shadow: 1px 1px 1px #ed5d69;
-moz-box-shadow: 1px 1px 1px #ed5d69;
box-shadow: 1px 1px 1px #ed5d69;
}
a.red div.arrow span.bottomShadow { border-top: 8px solid #ed5d69 }
/* ORANGE
================================================== */
a.orange {
background-color: #ff8636;
background-image: -webkit-linear-gradient(top, #ff8636, #9a3e00);
background-image: -moz-linear-gradient(top, #ff8636, #9a3e00);
background-image: -ms-linear-gradient(top, #ff8636, #9a3e00);
background-image: -o-linear-gradient(top, #ff8636, #9a3e00);
background-image: linear-gradient(top, #ff8636, #9a3e00);
text-shadow: 1px 1px 1px #ff7f42;
border-top: 1px solid #ffa542;
}
a.orange span.bar {
-webkit-box-shadow: 1px 1px 1px #ff7f42;
-moz-box-shadow: 1px 1px 1px #ff7f42;
box-shadow: 1px 1px 1px #ff7f42;
}
a.orange div.arrow span.top {
-webkit-box-shadow: 1px 1px 1px #ff7f42;
-moz-box-shadow: 1px 1px 1px #ff7f42;
box-shadow: 1px 1px 1px #ff7f42;
}
a.orange div.arrow span.bottomShadow { border-top: 8px solid #ff7f42 }
/* YELLOW
================================================== */
a.yellow {
background-color: #fcd116;
background-image: -webkit-linear-gradient(top, #fcd116, #705b00);
background-image: -moz-linear-gradient(top, #fcd116, #705b00);
background-image: -ms-linear-gradient(top, #fcd116, #705b00);
background-image: -o-linear-gradient(top, #fcd116, #705b00);
background-image: linear-gradient(top, #fcd116, #705b00);
text-shadow: 1px 1px 1px #ffc33d;
border-top: 1px solid #ffff3d;
}
a.yellow span.bar {
-webkit-box-shadow: 1px 1px 1px #ffc33d;
-moz-box-shadow: 1px 1px 1px #ffc33d;
box-shadow: 1px 1px 1px #ffc33d;
}
a.yellow div.arrow span.top {
-webkit-box-shadow: 1px 1px 1px #ffc33d;
-moz-box-shadow: 1px 1px 1px #ffc33d;
box-shadow: 1px 1px 1px #ffc33d;
}
a.yellow div.arrow span.bottomShadow { border-top: 8px solid #ffc33d }
/* FOR DEMO PURPOSE ONLY
================================================== */
a.grey {
position: absolute;
top: 80px;
left: 80px;
}
a.blue {
position: absolute;
top: 80px;
left: 260px;
}
a.green {
position: absolute;
top: 140px;
left: 80px;
}
a.red {
position: absolute;
top: 140px;
left: 260px;
}
a.orange {
position: absolute;
top: 200px;
left: 80px;
}
a.yellow {
position: absolute;
top: 200px;
left: 260px;
}
</style>
</head>
<body>
<a href="http://cssdeck.com/item/20/download-button-set-no-images" style="position: absolute; top: -1px; right: -1px; z-index: 1000; overflow: hidden; background: #ccc; color: #333; text-shadow: 0px 1px 1px #fff; text-decoration: none; padding: 5px 10px; display: inline-block; border: 0; font-size: 12px; font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-weight: bold;">Back To Item</a>
<div class="container">
<a class="button grey">
<div class="arrow">
<span class="top"></span>
<span class="bottom"></span>
<span class="bottomShadow"></span>
</div>
<span class="bar"></span>
下载
</a>
<a class="button blue">
<div class="arrow">
<span class="top"></span>
<span class="bottom"></span>
<span class="bottomShadow"></span>
</div>
<span class="bar"></span>
下载
</a>
<a class="button green">
<div class="arrow">
<span class="top"></span>
<span class="bottom"></span>
<span class="bottomShadow"></span>
</div>
<span class="bar"></span>
下载
</a>
<a class="button red">
<div class="arrow">
<span class="top"></span>
<span class="bottom"></span>
<span class="bottomShadow"></span>
</div>
<span class="bar"></span>
下载
</a>
<a class="button orange">
<div class="arrow">
<span class="top"></span>
<span class="bottom"></span>
<span class="bottomShadow"></span>
</div>
<span class="bar"></span>
下载
</a>
<a class="button yellow">
<div class="arrow">
<span class="top"></span>
<span class="bottom"></span>
<span class="bottomShadow"></span>
</div>
<span class="bar"></span>
下载
</a>
</div>
</body>
</html>
HTML / CSS 相关文章推荐
CSS中一些@规则的用法小结
Mar 09 HTML / CSS
CSS3动画之流彩文字效果+图片模糊效果+边框伸展效果实现代码合集
Aug 18 HTML / CSS
用CSS禁用输入法(CSS3 UI规范)实例解析
Dec 04 HTML / CSS
css3与html5实现响应式导航菜单(导航栏)效果分享
Feb 12 HTML / CSS
css3 伪元素和伪类选择器详解
Sep 04 HTML / CSS
一款基于css3的列表toggle特效实例教程
Jan 04 HTML / CSS
html5 viewport使用方法示例详解
Dec 02 HTML / CSS
移动端html5模拟长按事件的实现方法
Sep 30 HTML / CSS
解决HTML5中滚动到底部的事件问题
Aug 22 HTML / CSS
如何给HTML标签中的文本设置修饰线
Nov 18 HTML / CSS
z-index不起作用
Mar 31 HTML / CSS
纯CSS3实现div按照顺序出入效果
Jul 15 HTML / CSS
利用css3制作3D样式按钮实现代码
Mar 18 #HTML / CSS
css3 按钮样式简单可扩展创建
Mar 18 #HTML / CSS
css3气泡 css3关键帧动画创建的动态通知气泡
Feb 26 #HTML / CSS
css 省略号 css3让多余的字符串消失并附加省略号的实现代码
Feb 07 #HTML / CSS
7款设计巧妙的css3飘带状3D立体效果的导航菜单和表单窗口
Feb 04 #HTML / CSS
8款精美的CSS3表单设计(登录表单/下拉选择/按钮附演示及源码)
Feb 04 #HTML / CSS
css3实现针线缝合效果(图解步骤)
Feb 04 #HTML / CSS
You might like
一些常用的php函数
2006/12/06 PHP
php处理抢购类功能的高并发请求
2018/02/08 PHP
EasyUi tabs的高度与宽度根据IE窗口的变化自适应代码
2010/10/26 Javascript
Javascript 判断是否存在函数的方法
2013/01/03 Javascript
制作jquery遮罩层效果导航菜单代码分享
2013/12/25 Javascript
一个JavaScript获取元素当前高度的实例
2014/10/29 Javascript
javascript实现节点(div)名称编辑
2014/12/17 Javascript
JavaScript原生对象之Date对象的属性和方法详解
2015/03/13 Javascript
Javascript 是你的高阶函数(高级应用)
2015/06/15 Javascript
jQuery实现仿腾讯迷你首页选项卡效果代码
2015/09/17 Javascript
jquery实现两边飘浮可关闭的对联广告
2015/11/27 Javascript
JS去除重复并统计数量的实现方法
2016/12/15 Javascript
VueJs 将接口用webpack代理到本地的方法
2017/11/27 Javascript
vue 中filter的多种用法
2018/04/26 Javascript
详解基于mpvue的小程序markdown适配解决方案
2018/05/08 Javascript
vue 中动态绑定class 和 style的方法代码详解
2018/06/01 Javascript
vue内置组件transition简单原理图文详解(小结)
2018/07/12 Javascript
vue使用自定义指令实现拖拽
2021/01/29 Javascript
angularjs请求数据的方法示例
2019/08/06 Javascript
js实现踩五彩块游戏
2020/02/08 Javascript
小程序跳转H5页面的方法步骤
2020/03/06 Javascript
vue开发chrome插件,实现获取界面数据和保存到数据库功能
2020/12/01 Vue.js
打印出python 当前全局变量和入口参数的所有属性
2009/07/01 Python
Python使用cookielib模块操作cookie的实例教程
2016/07/12 Python
Django rest framework基本介绍与代码示例
2018/01/26 Python
用Eclipse写python程序
2018/02/10 Python
美国知名女性服饰品牌:New York & Company
2017/03/23 全球购物
大学生四个方面的自我评价
2013/09/19 职场文书
影视艺术学院毕业生自荐信
2013/11/13 职场文书
大三毕业自我鉴定
2014/01/15 职场文书
网络技术专业推荐信
2014/02/20 职场文书
人力资源管理专业毕业生自荐书
2014/05/25 职场文书
2014年女职工工作总结
2014/11/27 职场文书
2015年社区中秋节活动总结
2015/03/23 职场文书
圣贤教育改变命运观后感
2015/06/16 职场文书
《颐和园》教学反思
2016/02/19 职场文书