使用CSS3实现的3D按钮精美效果代码

使用css3代码来制作3d按钮效果,这是一个系列的3d按钮制作效果,制作方法是老套(万变不离其中),但其中色彩的调各非常不错,因为很多效果在ps中制作是容易,特别对于设计师来说更容易,但对于一名coder来说,还是有点困难,具体请看制作的代码,让代码来展现所有的一切。我想您和我一样会为这样的效果折服.

使用CSS3实现的3D按钮精美效果代码

CSS3实现的3D按钮效果body { background: -webkit-radial-gradient(#fdfdfd,#e5e5e5); background: -moz-radial-gradient(#fdfdfd,#e5e5e5); background: -ms-radial-gradient(#fdfdfd,#e5e5e5); background: -o-radial-gradient(#fdfdfd,#e5e5e5);  radial-gradient(#fdfdfd,#e5e5e5);}        .demo { width: 250px; margin: 80px auto 0;}.demo div { margin-bottom: 20px; }.onload,.search { position: relative; display: inline-block; line-height: 25px; padding: 10px 15px; border-radius: 5px; color: #fff; font-weight: bold; text-shadow:0 1px 2px rgba(0,0,0,.4);}.onload { width: 130px; font-size: 14px;}.search { width: 30px; margin-left: 20px;}.onload:after,.search:after { display: inline-block; font-family: 'icomoon'; font-style: normal; speak: none; font-weight: normal; -webkit-font-smoothing: antialiased; content: "21"; font-size: 20px; padding-left: 5px;}. { content: "22"; padding-left: 14px; margin-left: 14px;}.onload:before,search:before { position: absolute; top: 0; right: 0; display: inline-block; content: ""; width: 90px; height: 59px; background: -webkit-radial-gradient(right,rgba(255,255,255,.3),rgba(255,255,255,0) 70%); background: -moz-radial-gradient(right,rgba(255,255,255,.3),rgba(255,255,255,0) 70%); background: -ms-radial-gradient(right,rgba(255,255,255,.3),rgba(255,255,255,0) 70%); background: -o-radial-gradient(right,rgba(255,255,255,.3),rgba(255,255,255,0) 70%);  radial-gradient(right,rgba(255,255,255,.3),rgba(255,255,255,0 ) 70%);}.onload:hover,.search:hover { color: #fff; text-decoration: none;}.onload:active,.search:active { top:8px; box-shadow: 0 1px 6px rgba(0,0,0,.2) inset;}.pink { border:1px solid #de73bd; box-shadow: 0 0 0 1px #883b73,1px 5px 0 #883b73,-1px 5px 0 #883b73,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#d745a4,#bd368d); background: -moz-linear-gradient(top,#d745a4,#bd368d); background: -ms-linear-gradient(top,#d745a4,#bd368d); background: -o-linear-gradient(top,#d745a4,#bd368d);  linear-gradient(top,#d745a4,#bd368d);}.onload.pink:after { box-shadow: -1px 0 0 #8f3879,-2px 0 0 #e691cd;}.pink:hover { background: -webkit-linear-gradient(top,#ea6abd,#bd368d); background: -moz-linear-gradient(top,#ea6abd,#bd368d); background: -ms-linear-gradient(top,#ea6abd,#bd368d); background: -o-linear-gradient(top,#ea6abd,#bd368d);  linear-gradient(top,#ea6abd,#bd368d);}.pink:active { background: -webkit-linear-gradient(top,#bd368d,#bd368d); background: -moz-linear-gradient(top,#bd368d,#bd368d); background: -ms-linear-gradient(top,#bd368d,#bd368d); background: -o-linear-gradient(top,#bd368d,#bd368d);  linear-gradient(top,#bd368d,#bd368d);}.purple { border:1px solid #b271e5; box-shadow: 0 0 0 1px #883b73,1px 5px 0 #883b73,-1px 5px 0 #883b73,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#9246d7,#8339c2); background: -moz-linear-gradient(top,#9246d7,#8339c2); background: -ms-linear-gradient(top,#9246d7,#8339c2); background: -o-linear-gradient(top,#9246d7,#8339c2);  linear-gradient(top,#9246d7,#8339c2);}.onload.purple:after { box-shadow: -1px 0 0 #5d297b,-2px 0 0 #c998e7;}.purple:hover { background: -webkit-linear-gradient(top,#a35de6,#7733be); background: -moz-linear-gradient(top,#a35de6,#7733be); background: -ms-linear-gradient(top,#a35de6,#7733be); background: -o-linear-gradient(top,#a35de6,#7733be);  linear-gradient(top,#a35de6,#7733be);}.purple:active { background: -webkit-linear-gradient(top,#8339c2,#8339c2); background: -moz-linear-gradient(top,#8339c2,#8339c2); background: -ms-linear-gradient(top,#8339c2,#8339c2); background: -o-linear-gradient(top,#8339c2,#8339c2);  linear-gradient(top,#8339c2,#8339c2);}.sky_blue { border:1px solid #7cccff; box-shadow: 0 0 0 1px #007ac7,1px 5px 0 #007ac7,-1px 5px 0 #007ac7,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#4db5fe,#3c9be2); background: -moz-linear-gradient(top,#4db5fe,#3c9be2); background: -ms-linear-gradient(top,#4db5fe,#3c9be2); background: -o-linear-gradient(top,#4db5fe,#3c9be2);  linear-gradient(top,#4db5fe,#3c9be2);}.onload.sky_blue:after { box-shadow: -1px 0 0 #2c6c7f,-2px 0 0 #99d5fa;}.sky_blue:hover { background: -webkit-linear-gradient(top,#76c6ff,#3c9ce4); background: -moz-linear-gradient(top,#76c6ff,#3c9ce4); background: -ms-linear-gradient(top,#76c6ff,#3c9ce4); background: -o-linear-gradient(top,#76c6ff,#3c9ce4);  linear-gradient(top,#76c6ff,#3c9ce4);}.sky_blue:active { background: -webkit-linear-gradient(top,#3c9be2,#3c9be2); background: -moz-linear-gradient(top,#3c9be2,#3c9be2); background: -ms-linear-gradient(top,#3c9be2,#3c9be2); background: -o-linear-gradient(top,#3c9be2,#3c9be2);  linear-gradient(top,#3c9be2,#3c9be2);}.green { border:1px solid #9bcf60; box-shadow: 0 0 0 1px #469a44,1px 5px 0 #469a44,-1px 5px 0 #469a44,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#8dd845,#6fbb31); background: -moz-linear-gradient(top,#8dd845,#6fbb31); background: -ms-linear-gradient(top,#8dd845,#6fbb31); background: -o-linear-gradient(top,#8dd845,#6fbb31);  linear-gradient(top,#8dd845,#6fbb31);}.onload.green:after { box-shadow: -1px 0 0 #597b2d,-2px 0 0 #c6e897;}.green:hover { background: -webkit-linear-gradient(top,#9de15d,#74bf37); background: -moz-linear-gradient(top,#9de15d,#74bf37); background: -ms-linear-gradient(top,#9de15d,#74bf37); background: -o-linear-gradient(top,#9de15d,#74bf37);  linear-gradient(top,#9de15d,#74bf37);}.green:active { background: -webkit-linear-gradient(top,#6fbb31,#6fbb31); background: -moz-linear-gradient(top,#6fbb31,#6fbb31); background: -ms-linear-gradient(top,#6fbb31,#6fbb31); background: -o-linear-gradient(top,#6fbb31,#6fbb31);  linear-gradient(top,#6fbb31,#6fbb31);}.yellow { border:1px solid #e0e571; box-shadow: 0 0 0 1px #87883b,1px 5px 0 #87883b,-1px 5px 0 #87883b,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#d1d744,#bbbf39); background: -moz-linear-gradient(top,#d1d744,#bbbf39); background: -ms-linear-gradient(top,#d1d744,#bbbf39); background: -o-linear-gradient(top,#d1d744,#bbbf39);  linear-gradient(top,#d1d744,#bbbf39);}.onload.yellow:after { box-shadow: -1px 0 0 #597b2d,-2px 0 0 #c6e897;}.yellow:hover { background: -webkit-linear-gradient(top,#dadd50,#c0c442); background: -moz-linear-gradient(top,#dadd50,#c0c442); background: -ms-linear-gradient(top,#dadd50,#c0c442); background: -o-linear-gradient(top,#dadd50,#c0c442);  linear-gradient(top,#dadd50,#c0c442);}.yellow:active { background: -webkit-linear-gradient(top,#bbbf39,#bbbf39); background: -moz-linear-gradient(top,#bbbf39,#bbbf39); background: -ms-linear-gradient(top,#bbbf39,#bbbf39); background: -o-linear-gradient(top,#bbbf39,#bbbf39);  linear-gradient(top,#bbbf39,#bbbf39);}.orange { border:1px solid #e5bf76; box-shadow: 0 0 0 1px #88683b,1px 5px 0 #88683b,-1px 5px 0 #88683b,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#e0b956,#bb8231); background: -moz-linear-gradient(top,#e0b956,#bb8231); background: -ms-linear-gradient(top,#e0b956,#bb8231); background: -o-linear-gradient(top,#e0b956,#bb8231);  linear-gradient(top,#e0b956,#bb8231);}.onload.orange:after { box-shadow: -1px 0 0 #7e6a33,-2px 0 0 #e8ce98;}.orange:hover { background: -webkit-linear-gradient(top,#e7c369,#c18838); background: -moz-linear-gradient(top,#e7c369,#c18838); background: -ms-linear-gradient(top,#e7c369,#c18838); background: -o-linear-gradient(top,#e7c369,#c18838);  linear-gradient(top,#e7c369,#c18838);}.orange:active { background: -webkit-linear-gradient(top,#bb8231,#bb8231); background: -moz-linear-gradient(top,#bb8231,#bb8231); background: -ms-linear-gradient(top,#bb8231,#bb8231); background: -o-linear-gradient(top,#bb8231,#bb8231);  linear-gradient(top,#bb8231,#bb8231);}.red { border:1px solid #e57171; box-shadow: 0 0 0 1px #883b3b,1px 5px 0 #883b3b,-1px 5px 0 #883b3b,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#d74444,#c43a3a); background: -moz-linear-gradient(top,#d74444,#c43a3a); background: -ms-linear-gradient(top,#d74444,#c43a3a); background: -o-linear-gradient(top,#d74444,#c43a3a);  linear-gradient(top,#d74444,#c43a3a);}.onload.red:after { box-shadow: -1px 0 0 #8b3737,-2px 0 0 #e69090;}.red:hover { background: -webkit-linear-gradient(top,#e25c5c,#cc4646); background: -moz-linear-gradient(top,#e25c5c,#cc4646); background: -ms-linear-gradient(top,#e25c5c,#cc4646); background: -o-linear-gradient(top,#e25c5c,#cc4646);  linear-gradient(top,#e25c5c,#cc4646);}.orange:active { background: -webkit-linear-gradient(top,#c43a3a,#c43a3a); background: -moz-linear-gradient(top,#c43a3a,#c43a3a); background: -ms-linear-gradient(top,#c43a3a,#c43a3a); background: -o-linear-gradient(top,#c43a3a,#c43a3a);  linear-gradient(top,#c43a3a,#c43a3a);}.gray { border:1px solid #d6d6d7; box-shadow: 0 0 0 1px #919191,1px 5px 0 #919191,-1px 5px 0 #919191,0 6px 8px rgba(0,0,0,.8); background: -webkit-linear-gradient(top,#bdbebf,#ababac); background: -moz-linear-gradient(top,#bdbebf,#ababac); background: -ms-linear-gradient(top,#bdbebf,#ababac); background: -o-linear-gradient(top,#bdbebf,#ababac);  linear-gradient(top,#bdbebf,#ababac);}.onload.gray:after { box-shadow: -1px 0 0 #7b7a7a,-2px 0 0 #dbdbdc;}.gray:hover { background: -webkit-linear-gradient(top,#cbcccd,#9e9fa0); background: -moz-linear-gradient(top,#cbcccd,#9e9fa0); background: -ms-linear-gradient(top,#cbcccd,#9e9fa0); background: -o-linear-gradient(top,#cbcccd,#9e9fa0);  linear-gradient(top,#cbcccd,#9e9fa0);}.gray:active { background: -webkit-linear-gradient(top,#ababac,#ababac); background: -moz-linear-gradient(top,#ababac,#ababac); background: -ms-linear-gradient(top,#ababac,#ababac); background: -o-linear-gradient(top,#ababac,#ababac);  linear-gradient(top,#ababac,#ababac);}@font-face { font-family: 'icomoon'; url('fonts /icomoon.eot'); url('fonts /icomoon.eot?#iefix') format('embedded-opentype'),  url('fonts/icomoon.svg#icomoon') format('svg'),  url('fonts/icomoon.woff') format('woff'),  url('fonts/icomoon.ttf') format('truetype'); font-weight: normal; font-style: normal;}    

以上就是使用CSS3实现的3D按钮精美效果代码的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/1608334.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2025年12月23日 21:42:54
下一篇 2025年12月23日 21:43:05

相关推荐

  • 详解css3的弹性盒模型

    Flexbox通常能让我们更好的操作他的子元素布局,例如:  如果元素容器没有足够的空间,我们无需计算每个元素的宽度,就可以设置他们在同一行;  可以快速让他们布局在一列;  可以方便让他们对齐容器的左、右、中间等;  无需修改结构就可以改变他们的显示顺序;  如果元素容器设置百分比和视窗大小改变,…

    2025年12月23日
    000
  • 元素水平垂直居中的css3实现实例代码

    这篇文章主要为大家详细介绍了元素水平垂直居中的css3实现实例代码,具有一定的参考价值,感兴趣的小伙伴们可以参考一下 话不多说,代码如下 伸缩布局*{ margin: 0; padding:0; -webkit-box-sizing: border-box; box-sizing: border-b…

    好文分享 2025年12月23日
    000
  • CSS3文本两种实例效果

    css3文本效果实例1: 文本阴影: CSS3 文本阴影h1{text-shadow: 5px 5px 5px #FF0000;}文本阴影效果!     立即学习“前端免费学习笔记(深入)”; 实例二:CSS3自动换行 CSS3 自动换行 p.test{width:11em;border:1px s…

    好文分享 2025年12月23日
    000
  • CSS3多列的三种实例介绍

    这篇文章主要为大家详细介绍了css3多列的三种实例的相关资料,需要的朋友可以参考下 CSS3多列实例1: CSS3 列规则 .newspaper{-moz-column-count:3; /* Firefox */-webkit-column-count:3; /* Safari and Chrom…

    2025年12月23日
    000
  • css3新特性应用之视觉效果详细解读

    目录 padding 背景与边框第一部分 背景与边框第二部分 形状 视觉效果 字体排印 立即学习“前端免费学习笔记(深入)”; 用户体验 结构与布局 过渡与动画 源码下载 一、单侧阴影 box-shadow属性的应用,格式:h-shadow v-shadow blur spread color in…

    2025年12月23日 好文分享
    000
  • 用css3简单的制作3d半透明立方体图片详解

    new document //css部分html{font-size:62.5%;}img{width:300px;height:300px;} #stage{//搭建一个舞台margin-top:200px;margin-left:auto;margin-right:auto;width:300p…

    好文分享 2025年12月23日
    000
  • CSS3复杂选择器的详解

    今天把视频里的CSS3复杂选择器部分看完了,来整理一下学到的知识点。 1、兄弟选择器:同一位置级别,可称为兄弟元素 a、相邻兄弟选择器:next紧紧跟在【当前元素之后的】(一个),指定选择器的元素           语法:通过“+”作为结合符eg: p+p ->紧跟在p后面的p元素 这是第一…

    2025年12月23日
    000
  • 使用CSS3仿微信聊天小气泡的实例介绍

    今天给大家分享一个我刚做的项目中的一个小案例, 因为我们在做一个聊天的功能,之前的聊天页面ui很丑,我就不在这里展示给大家了。 现在就教大家怎么用css3制作一个和微信聊天界面一样的页面。 首先给大家看看页面的样子吧,如下图所示: 小月博客仿微信聊天界面 立即学习“前端免费学习笔记(深入)”; 页面…

    2025年12月23日
    000
  • 利用CSS3实现进度条的两方法介绍

    这篇文章主要给大家介绍了利用css3实现进度条的两种姿势,文中给出了详细的示例代码和图文介绍,对大家具有一定的参考价值,需要的朋友们下面来一起看看吧。 效果图如下:     第一种姿势如下  先上代码 /*对应CSS*/ #progress{ width: 300px; height: 30px; …

    2025年12月23日 好文分享
    000
  • 使用css3的ie写法示例

    这篇文章详解使用css3的ie写法示例 linear-gradient background: linear-gradient(to bottom, #97c1e0 0%, #086cb6 100%);filter: progid:DXImageTransform.Microsoft.Gradien…

    好文分享 2025年12月23日
    000
  • 关于CSS3阴影使用方法介绍

    一、边框阴影 标准语法: box-shadow : h-offset  v-offset  blur  spread  color [   inset ] ,…  [ 偏移量向右下为正值,左上为负值 ] a、若有多重阴影,用逗号分隔,且依次往下叠加,最先写的在最上面 b、若有inset,…

    好文分享 2025年12月23日
    000
  • 详解CSS3页面布局浏览器兼容与前端性能优化方法

    css如何垂直居中一个元素的问题已经是一个老生常谈的问题了。不管对于一个新手或者老手,在面试过程中是经常被问到的。前两天在看一个flex的视频教程,当中提到了有关元素的居中问题,所以今天小编就来扒一扒几种常见的方式。不足之处请大家批评指正(所有的代码都是自己亲手敲过可用的) 1、水平居中(margi…

    2025年12月23日 好文分享
    000
  • CSS3新特性绘制常见图形方法介绍

    前言:最近准备做一个自己的网页,设计稿中导航我准备设计成矩形,也有hover样式展示的矩形,当中一些头像等等。以前除了画圆,好像真没认真画过其他图形,今天就画画我们常见到的几个图形。 在此之前我们有必要了解下什么是伪元素(和它不同的,还有一个概念叫伪类,两者容易混淆),没有它画不成图形的。 a)伪元…

    好文分享 2025年12月23日
    000
  • 使用CSS3变形、过渡、动画、关联属性解析

    一、变形 transform:可以对元素对象进行旋转rotate、缩放scale、移动translate、倾斜skew、矩阵变形matrix。示例: transform: rotate(90deg) scale(1.5,0.8) translate(100px,50px) skew(45deg,45…

    好文分享 2025年12月23日
    000
  • 使用CSS3 3D行星运转以及浏览器渲染原理详细介绍

    最近入坑 Web 动画,所以把自己的学习过程记录一下分享给大家。 CSS3 3D 行星运转 demo 页面请戳:Demo。(建议使用Chrome打开) 本文完整的代码,以及更多的 CSS3 效果,在我 Github 上可以看到,也希望大家可以点个 star。 嗯,可能有些人打不开 demo 或者页面…

    2025年12月23日 好文分享
    000
  • 使用CSS3炫酷的发光文字自定义文字色彩的方法

    background:#eeefff;这是一款基于纯CSS3的文字发光特效,当我们将鼠标滑过文字时,文字就会模拟发光动画,展现出非常酷的发光画面。另外,由于引用了特殊字体,所以整个文字效果看起来有着3D立体的特效,如果你的网络无法加载这些字体,可能是由于国外的这个网站被墙的缘故,就像google的字…

    2025年12月23日
    000
  • 使用CSS3实现绚丽的飘带样式菜单方法介绍

    background:#eeefff;这是一款很漂亮很有特色的CSS3菜单插件,和普通的菜单不同,它拥有飘带的外观,同时,鼠标滑过菜单项时,菜单项又会突起显示,很有3D立体的视觉效果。结合网页的背景,这款菜单就更显立体感了。有需要的前端设计师可以通过研究源码来使用这款菜单插件,当然,这也需要你的浏览…

    2025年12月23日
    000
  • 使用纯CSS3人物行走动画实例代码

    今天分享给大家的是一个用纯css3实现的人物行走动画,在没有使用javascript的情况下,用css3技术将人物行走的姿态描绘得非常逼真。其实动画实现的原理也是比较简单的,将人物行走时的状态分割成多张图片,然后利用css3的动画属性将这些图片串联起来形成人物行走动画效果。 在线演示源码下载 HTM…

    2025年12月23日
    000
  • 使用CSS3实现百叶窗焦点图动画实例代码

    background:#eeefff;这是一款基于CSS3的百叶窗焦点图动画,一共有4种不同的百叶窗动画风格,每一个都看似非常简单,但是却又相当实用。更值得注意的是插件提供了4种不同的百叶窗特效,有水平百叶窗、垂直百叶窗和淡入淡出百叶窗等。并且,该CSS3百叶窗图片切换插件切换时非常平滑,效果很不错…

    2025年12月23日
    000
  • 使用纯CSS3实现时间轴切换焦点图实例代码

    background:#eeefff;这是一款基于jQuery和CSS3的焦点图动画插件,插件非常迷你,功能也比较简单,它的特点是图片切换按钮类似一条时间轴,点击时间轴的圆圈即可切换到相应的图片。点击切换按钮时,按钮会出现渐隐渐显的发光特效,图片切换过程中整张图片过渡的效果非常柔和,并且图片描述也相…

    2025年12月23日 好文分享
    000

发表回复

登录后才能评论
关注微信