纯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将你的设计带入下个高度
Aug 08 HTML / CSS
让IE6支持css3,让 IE7、IE8 都支持CSS3
Oct 09 HTML / CSS
使用 CSS3 中@media 实现网页自适应的示例代码
Mar 24 HTML / CSS
html5触摸事件判断滑动方向的实现
Jun 05 HTML / CSS
Canvas 文字碰撞检测并抽稀的方法
May 27 HTML / CSS
使用html2canvas将页面转成图并使用用canvas2image下载
Apr 04 HTML / CSS
利用html5的websocket实现websocket聊天室
Dec 12 HTML / CSS
HTML5标签使用方法详解
Nov 27 HTML / CSS
HTML5中的音频和视频媒体播放元素小结
Jan 29 HTML / CSS
HTML5语义化元素你真的用对了吗
Aug 22 HTML / CSS
关于html选择框创建占位符的问题
Jun 09 HTML / CSS
css filter和getUserMedia的联合使用
Feb 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利用单例模式实现日志处理类库
2014/02/10 PHP
PHP实现的注册,登录及查询用户资料功能API接口示例
2017/06/06 PHP
jQuery Study Notes学习笔记 (二)
2010/08/04 Javascript
编写自己的jQuery插件简单实现代码
2011/04/19 Javascript
js确认删除对话框效果的示例代码
2014/02/20 Javascript
原生js实现类似弹窗抖动效果
2015/04/02 Javascript
浅谈window对象的scrollBy()方法
2015/07/15 Javascript
javascript自动恢复文本框点击清除后的默认文本
2016/01/12 Javascript
AngularJS入门心得之directive和controller通信过程
2016/01/25 Javascript
jQuery layui常用方法介绍
2016/07/25 Javascript
JavaScript获取服务器时间的方法详解
2016/12/11 Javascript
jQuery插件HighCharts绘制2D饼图效果示例【附demo源码下载】
2017/03/21 jQuery
Vue.js实战之组件的进阶
2017/04/04 Javascript
javascript 中iframe高度自适应(同域)实例详解
2017/05/16 Javascript
Node Puppeteer图像识别实现百度指数爬虫的示例
2018/02/22 Javascript
[02:17]《辉夜杯》TRG战队巡礼
2015/10/26 DOTA
在Python中使用Mako模版库的简单教程
2015/04/08 Python
python中将一个全部为int的list 转化为str的list方法
2018/04/09 Python
matplotlib subplots 设置总图的标题方法
2018/05/25 Python
Python 利用高德地图api实现经纬度与地址的批量转换
2019/08/14 Python
python生成器推导式用法简单示例
2019/10/08 Python
浅谈python3打包与拆包在函数的应用详解
2020/05/02 Python
在pycharm中使用matplotlib.pyplot 绘图时报错的解决
2020/06/01 Python
使用Keras加载含有自定义层或函数的模型操作
2020/06/10 Python
pycharm 实现调试窗口恢复
2021/02/05 Python
美国在线纱线商店:Darn Good Yarn
2019/03/20 全球购物
阿迪达斯印尼官方网站:adidas印尼
2020/02/10 全球购物
什么是servlet链?
2014/07/13 面试题
教师师德教育的自我评价
2013/10/31 职场文书
家居设计专业个人自荐信范文
2013/11/26 职场文书
称象教学反思
2014/02/03 职场文书
产品开发计划书
2014/04/27 职场文书
英语求职信范文
2014/05/23 职场文书
激励员工的口号
2014/06/16 职场文书
2014年小学教研工作总结
2014/12/06 职场文书
项目技术负责人岗位职责
2015/04/13 职场文书