纯CSS3实现质感细腻丝滑按钮


Posted in HTML / CSS onMarch 09, 2021
	<div class="button gray"><div class="shine"></div>HTML5素材</div>
	<div class="button blue"><div class="shine"></div>jQuery素材</div>
	<div class="button green"><div class="shine"></div>HTML5素材</div><br/>
	<div class="button red"><div class="shine"></div>JS素材</div>
	<div class="button purple"><div class="shine"></div>html5tricks</div>
	<div class="button orange"><div class="shine"></div>HTML5资源教程</div>
.info
{
	margin-top: 50px;
}

.info a
{
	text-decoration: none;
	color: #fff;
	font-size: 15px
}

.button
{
	min-height: 1.5em;
	display: inline-block;
	padding: 12px 36px;
	margin: 40px 5px 5px 0px;
	cursor: pointer;
	opacity: 0.9;
	color: #FFF;
	font-size: 1em;
	letter-spacing: 1px;
	text-shadow: rgba(0,0,0,0.9) 0px 1px 2px;
	background: #434343;
	border: 1px solid #242424;
	-webkit-border-radius: 4px;
	-khtml-border-radius: 4px;
	-moz-border-radius: 4px;
	-o-border-radius: 4px;
	border-radius: 4px;
	-webkit-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-khtml-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-moz-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-o-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-webkit-transition: all 0.1s linear;
	-khtml-transition: all 0.1s linear;
	-moz-transition: all 0.1s linear;
	-o-transition: all 0.1s linear;
	transition: all 0.1s linear;
}

.button:hover
{
	-webkit-box-shadow: rgba(0,0,0,0.5) 0px 2px 5px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-khtml-box-shadow: rgba(0,0,0,0.5) 0px 2px 5px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-moz-box-shadow: rgba(0,0,0,0.5) 0px 2px 5px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-o-box-shadow: rgba(0,0,0,0.5) 0px 2px 5px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	box-shadow: rgba(0,0,0,0.5) 0px 2px 5px, inset rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(0,0,0,0.25) 0px 0px 0px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
}

.button:active
{
	-webkit-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px,inset rgba(255,255,255,0) 0px 1px 0px, inset rgba(0,0,0,0.5) 0px 0px 5px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-khtml-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px,inset rgba(255,255,255,0) 0px 1px 0px, inset rgba(0,0,0,0.5) 0px 0px 5px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-moz-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0) 0px 1px 0px, inset rgba(0,0,0,0.5) 0px 0px 5px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	-o-box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0) 0px 1px 0px, inset rgba(0,0,0,0.5) 0px 0px 5px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
	box-shadow: rgba(255,255,255,0.25) 0px 1px 0px, inset rgba(255,255,255,0) 0px 1px 0px, inset rgba(0,0,0,0.5) 0px 0px 5px, inset rgba(255,255,255,0.03) 0px 20px 0px, inset rgba(0,0,0,0.15) 0px -20px 20px, inset rgba(255,255,255,0.05) 0px 20px 20px;
}

.shine
{
	display: block;
	position: relative;
	background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0) 100%);
	background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(50%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0)));
	background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
	background: -o-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
	background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#00ffffff',GradientType=1 );
	background: linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 50%,rgba(255,255,255,0) 100%);
	padding: 0px 12px;
	top: -12px;
	left: -24px;
	height: 1px;
	-webkit-box-shadow: rgba(255,255,255,0.2) 0px 1px 5px;
	-khtml-box-shadow: rgba(255,255,255,0.2) 0px 1px 5px;
	-moz-box-shadow: rgba(255,255,255,0.2) 0px 1px 5px;
	-o-box-shadow: rgba(255,255,255,0.2) 0px 1px 5px;
	box-shadow: rgba(255,255,255,0.2) 0px 1px 5px;
	-webkit-transition: all 0.3s ease-in-out;
	-khtml-transition: all 0.3s ease-in-out;
	-moz-transition: all 0.3s ease-in-out;
	-o-transition: all 0.3s ease-in-out;
	transition: all 0.3s ease-in-out;
}

.button:hover .shine
{
	left: 24px;
}

.button:active .shine
{
	opacity: 0;
}

.button.gray
{
	background: #555;
}

.button.blue
{
	background: #3a617e;
}

.button.green
{
	background: #477343;
}

.button.red
{
	background: #723131;
}

.button.purple
{
	background: #4b3f5e;
}

.button.orange
{
	background: #624529;
}
HTML / CSS 相关文章推荐
表单button的outline在firefox浏览器下的问题
Dec 24 HTML / CSS
一款纯css3实现的鼠标悬停动画按钮
Dec 29 HTML / CSS
CSS3中HSL和HSLA的简单使用示例
Jul 14 HTML / CSS
实例讲解CSS3中的box-flex弹性盒属性布局
Jun 09 HTML / CSS
CSS3+HTML5+JS 实现一个块的收缩与展开动画效果
Nov 17 HTML / CSS
HTML5 canvas基本绘图之绘制阴影效果
Jun 27 HTML / CSS
html5仿支付宝密码框的实现代码
Sep 06 HTML / CSS
HTML5之HTML元素扩展(下)—增强的Form表单元素值得关注
Jan 31 HTML / CSS
用HTML5实现网站在windows8中贴靠的方法
Apr 21 HTML / CSS
HTML5 Canvas画线技巧——实现绘制一个像素宽的细线
Aug 02 HTML / CSS
html5 移动端视频video的android兼容(去除播放控件、全屏)
Mar 26 HTML / CSS
amazeui页面校验功能的实现代码
Aug 24 HTML / CSS
css动画效果之animation的常用样式
Mar 09 #HTML / CSS
使用CSS3实现字体颜色渐变的实现
CSS心形加载的动画源码的实现
CSS中简写属性要注意TRouBLe的顺序问题(避免踩坑)
详解CSS样式中的 !important * _ 符号
a标签的css样式四个状态
Mar 09 #HTML / CSS
CSS中一些@规则的用法小结
Mar 09 #HTML / CSS
You might like
php中json_encode中文编码问题分析
2011/09/13 PHP
解析Ubuntu下crontab命令的用法
2013/06/24 PHP
PHP中exec与system用法区别分析
2014/09/22 PHP
thinkPHP2.1自定义标签库的导入方法详解
2016/07/20 PHP
php生成无限栏目树
2017/03/16 PHP
全面解析PHP面向对象的三大特征
2017/06/10 PHP
TP5(thinkPHP5)框架基于ajax与后台数据交互操作简单示例
2018/09/03 PHP
学习ExtJS table布局
2009/10/08 Javascript
JQuery对checkbox操作 (循环获取)
2011/05/20 Javascript
jquery实现的蓝色二级导航条效果代码
2015/08/24 Javascript
Javascript实现快速排序(Quicksort)的算法详解
2015/09/06 Javascript
jquery实现简单文字提示效果
2015/12/02 Javascript
AngularJS中的Directive自定义一个表格
2016/01/25 Javascript
JavaScript 数组中最大最小值
2016/06/05 Javascript
一次Webpack配置文件的分离实战记录
2018/11/30 Javascript
vue实现图片预览组件封装与使用
2019/07/13 Javascript
jquery实现轮播图特效
2020/04/12 jQuery
[04:14]从西雅图到上海——玩家自制DOTA2主题歌曲应援TI9
2019/07/11 DOTA
在windows下快速搭建web.py开发框架方法
2016/04/22 Python
Python何时应该使用Lambda函数
2019/07/02 Python
python实现静态web服务器
2019/09/03 Python
python抓取多种类型的页面方法实例
2019/11/20 Python
Python imageio读取视频并进行编解码详解
2019/12/10 Python
CSS3效果:自定义“W”形运行轨迹实例
2017/03/29 HTML / CSS
html5 浏览器支持 如何让所有的浏览器都支持HTML5标签样式
2012/12/07 HTML / CSS
5 个强大的HTML5 API 函数推荐
2014/11/19 HTML / CSS
高一地理教学反思
2014/01/18 职场文书
学习两会精神心得范文
2014/03/17 职场文书
小学学雷锋活动总结
2014/04/25 职场文书
戒毒悔改检讨书
2014/09/21 职场文书
我的中国梦主题班会
2015/08/14 职场文书
演讲开头怎么书写?
2019/08/06 职场文书
二年级作文之动物作文
2019/11/13 职场文书
nginx常用命令放入shell脚本详解
2021/03/31 Servers
PHP控制循环操作的时间
2021/04/01 PHP
PHP获取学生成绩的方法
2021/11/17 PHP