纯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 相关文章推荐
微信小程序实现可实时改变转速的css3旋转动画实例代码
Sep 11 HTML / CSS
HTML5 CSS3给网站设计带来出色效果
Jul 16 HTML / CSS
用CSS禁用输入法(CSS3 UI规范)实例解析
Dec 04 HTML / CSS
CSS3中设置3D变形的transform-style属性详解
May 23 HTML / CSS
css3 clip实现圆环进度条的示例代码
Feb 07 HTML / CSS
纯CSS3实现鼠标滑过按钮动画第二节
Jul 16 HTML / CSS
HTML5 和小程序实现拍照图片旋转、压缩和上传功能
Oct 08 HTML / CSS
HTML5标签小集
Aug 02 HTML / CSS
HTML5本地存储之Database Storage应用介绍
Jan 06 HTML / CSS
HTML5实现晶莹剔透的雨滴特效
May 14 HTML / CSS
HTML5 weui使用笔记
Nov 21 HTML / CSS
HTML5中在title标题标签里设置小图标的方法
Jun 23 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
提问的智慧
2006/10/09 PHP
改写函数实现PHP二维/三维数组转字符串
2013/09/13 PHP
Yii框架中 find findAll 查找出制定的字段的方法对比
2014/09/10 PHP
php使用str_replace实现输入框回车替换br的方法
2014/11/24 PHP
PHP实现生成唯一会员卡号
2015/08/24 PHP
功能强大的php文件上传类
2016/08/29 PHP
使用PHPExcel导出Excel表
2018/09/08 PHP
javascript+xml技术实现分页浏览
2008/07/27 Javascript
javascript attachEvent和addEventListener使用方法
2009/03/19 Javascript
Tinymce+jQuery.Validation使用产生的BUG
2010/03/29 Javascript
Javascript 通过json自动生成Dom的代码
2010/04/01 Javascript
js常用代码段整理
2011/11/30 Javascript
window.onload追加函数使用示例
2014/03/03 Javascript
用JavaScript实现类似于ListBox功能示例代码
2014/03/09 Javascript
JS数组的遍历方式for循环与for...in
2014/07/31 Javascript
javascript的函数劫持浅析
2016/09/26 Javascript
使用BootStrapValidator完成前端输入验证
2016/09/28 Javascript
webpack打包node.js后端项目的方法
2018/03/10 Javascript
小程序tab页无法传递参数的方法
2018/08/03 Javascript
mpvue中使用flyjs全局拦截的实现代码
2018/09/13 Javascript
Python代码解决RenderView窗口not found问题
2016/08/28 Python
详解python里使用正则表达式的全匹配功能
2017/10/19 Python
通过python将大量文件按修改时间分类的方法
2018/10/17 Python
python 对多个csv文件分别进行处理的方法
2019/01/07 Python
Django处理多用户类型的方法介绍
2019/05/18 Python
python进阶之自定义可迭代的类
2019/08/20 Python
python取均匀不重复的随机数方式
2019/11/27 Python
财务信息服务专业自荐书范文
2014/02/08 职场文书
HR求职自荐信范文
2014/06/21 职场文书
大学本科生职业生涯规划书范文
2014/09/14 职场文书
给朋友的道歉短信
2015/05/12 职场文书
周一问候语大全
2015/11/10 职场文书
2016简单的租房合同范本
2016/03/18 职场文书
2019年思想汇报
2019/06/20 职场文书
sql通过日期判断年龄函数的示例代码
2021/07/16 SQL Server
Javascript 解构赋值详情
2021/11/17 Javascript