web299.com
全部
教育
语言/资格考试
法律
互联网
政务民生
Word模板
Excel模板
PPT模板
网页特效
小程序模板
网站模板
首页
教育
语言/资格考试
法律
互联网
政务民生
Word模板
Excel模板
PPT模板
网页特效
小程序模板
网站模板
当前位置:
首页
>
网页特效
>
按钮特效
纯CSS3超酷彩色3D按钮样式
分类:
按钮特效
日期:
2024-05-14
点击(0)
评论(0)
演 示
免费下载
简介
##### HTML结构 按钮的基本HTML结构非常简单,使用一个超链接a元素来制作。 ```html
Button
``` ##### CSS样式 按钮的通用CSS样式如下。 ```html .button { background-color: #999; background-image: -webkit-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,0%,.1)); background-image: -moz-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,0%,.1)); background-image: -ms-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,0%,.1)); background-image: -o-linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,0%,.1)); background-image: linear-gradient(hsla(0,0%,100%,.05), hsla(0,0%,0%,.1)); border: none; border-radius: .5em; box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.2), inset 0 2px 0 hsla(0,0%,100%,.1), inset 0 1.2em 0 hsla(0,0%,100%,0.1), inset 0 -.2em 0 hsla(0,0%,100%,.1), inset 0 -.25em 0 hsla(0,0%,0%,.25), 0 .25em .25em hsla(0,0%,0%,.05); color: #444; cursor: pointer; display: inline-block; font-family: sans-serif; font-size: 1em; font-weight: bold; line-height: 1.5; margin: 0 .5em 1em; padding: .5em 1.5em .75em; position: relative; text-decoration: none; text-shadow: 0 1px 1px hsla(0,0%,100%,.25); vertical-align: middle; } .button:hover { outline: none; } .button:hover, .button:focus { box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.2), inset 0 2px 0 hsla(0,0%,100%,.1), inset 0 1.2em 0 hsla(0,0%,100%,.1), inset 0 -.2em 0 hsla(0,0%,100%,.1), inset 0 -.25em 0 hsla(0,0%,0%,.25), inset 0 0 0 3em hsla(0,0%,100%,.2), 0 .25em .25em hsla(0,0%,0%,.05); } .button:active { box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.2), inset 0 2px 0 hsla(0,0%,100%,.1), inset 0 1.2em 0 hsla(0,0%,100%,.1), inset 0 0 0 3em hsla(0,0%,100%,.2), inset 0 .25em .5em hsla(0,0%,0%,.05), 0 -1px 1px hsla(0,0%,0%,.1), 0 1px 1px hsla(0,0%,100%,.25); margin-top: .25em; outline: none; padding-bottom: .5em; } ``` 按钮上的文本样式如下。 ```html .lightText { box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.25), inset 0 2px 0 hsla(0,0%,100%,.1), inset 0 1.2em 0 hsla(0,0%,100%,.05), inset 0 -.2em 0 hsla(0,0%,100%,.1), inset 0 -.25em 0 hsla(0,0%,0%,.5), 0 .25em .25em hsla(0,0%,0%,.1); color: #fff; text-shadow: 0 -1px 1px hsla(0,0%,0%,.25); } .lightText:hover, .lightText:focus { box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.25), inset 0 2px 0 hsla(0,0%,100%,.1), inset 0 1.2em 0 hsla(0,0%,100%,.05), inset 0 -.2em 0 hsla(0,0%,100%,.1), inset 0 -.25em 0 hsla(0,0%,0%,.5), inset 0 0 0 3em hsla(0,0%,100%,.2), 0 .25em .25em hsla(0,0%,0%,.1); } .lightText:active { box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.25), inset 0 2px 0 hsla(0,0%,100%,.1), inset 0 1.2em 0 hsla(0,0%,100%,.05), inset 0 0 0 3em hsla(0,0%,100%,.2), inset 0 .25em .5em hsla(0,0%,0%,.05), 0 -1px 1px hsla(0,0%,0%,.1), 0 1px 1px hsla(0,0%,100%,.25); } ``` 按钮的各种尺寸,圆角和颜色的CSS样式如下。 ```html /* Large */ .large {font-size: 1.25em;} /* Medium */ .medium {font-size: 1em;} /* Small */ .small {font-size: .75em;} /* Regular */ .regular {border-radius: .5em;} /* Square */ .square {border-radius: .25em;} /* Round */ .round {border-radius: 1.25em;} /* Red */ .red {background-color: #ff6c6f;} /* Orange */ .orange {background-color: #f6cf6f;} /* Yellow */ .yellow {background-color: #fff6c6;} /* Green */ .green {background-color: #6fcf6f;} /* Blue */ .blue {background-color: #6fc6ff;} /* Purple */ .purple {background-color: #f6c6ff;} /* White */ .white {background-color: #eee;} /* Grey */ .grey {background-color: #999;} /* Black */ .black {background-color: #444;} ```
相关推荐
html5浪漫粒子表白文字特效
SlidesJS幻灯片特效
html5瀑布流相册特效
css3 svg实现的情人节表白鲜花动画特效
t-scroll.js基于ES6的DOM元素,过渡动画库插件
纯js写省市区三级联动效果
广告
广告