button 样式_(收藏)漂亮的css button样式汇总

  • 在网页设计过程中,程序员们常常需要配合美工来设计页面的美观效果,当然大部分页面风格都是美工的工作。但是按钮button样式,是我们程序员最常用的。
  • 下面我们就给大家介绍一些好看的button样式,大家可以直接复制代码在本地查看效果。这里的button样式没有使用任何图片,可以直接复制代码就可以了!
web前端学习:打造全网web前端全栈资料库(总目录)看完学的更快,掌握的更加牢固,你值得拥有(持续更新)​zhuanlan.zhihu.com

——注:源码里面使用了多种html标签做成按钮,有a,input,span,div,p,h3。总有适合你的标签

button样式源码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Demo: CSS3 Buttons</title>
<style type="text/css">
body {
 background: #ededed;
 width: 900px;
 margin: 30px auto;
 color: #999;
}
p {
 margin: 0 0 2em;
}
h1 {
 margin: 0;
}
a {
 color: #339;
 text-decoration: none;
}
a:hover {
 text-decoration: underline;
}
div {
 padding: 20px 0;
 border-bottom: solid 1px #ccc;
}
  
/* button 
---------------------------------------------- */
.button {
 display: inline-block;
 zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
 *display: inline;
 vertical-align: baseline;
 margin: 0 2px;
 outline: none;
 cursor: pointer;
 text-align: center;
 text-decoration: none;
 font: 14px/100% Arial, Helvetica, sans-serif;
 padding: .5em 2em .55em;
 text-shadow: 0 1px 1px rgba(0,0,0,.3);
 -webkit-border-radius: .5em; 
 -moz-border-radius: .5em;
 border-radius: .5em;
 -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
 -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
 box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.button:hover {
 text-decoration: none;
}
.button:active {
 position: relative;
 top: 1px;
}
  
.bigrounded {
 -webkit-border-radius: 2em;
 -moz-border-radius: 2em;
 border-radius: 2em;
}
.medium {
 font-size: 12px;
 padding: .4em 1.5em .42em;
}
.small {
 font-size: 11px;
 padding: .2em 1em .275em;
}
  
/* color styles 
---------------------------------------------- */
  
/* black */
.black {
 color: #d7d7d7;
 border: solid 1px #333;
 background: #333;
 background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
 background: -moz-linear-gradient(top,  #666,  #000);
 filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000');
}
.black:hover {
 background: #000;
 background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
 background: -moz-linear-gradient(top,  #444,  #000);
 filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000');
}
.black:active {
 color: #666;
 background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
 background: -moz-linear-gradient(top,  #000,  #444);
 filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#666666');
}
  
/* gray */
.gray {
 color: #e9e9e9;
 border: solid 1px #555;
 background: #6e6e6e;
 background: -webkit-gradient(linear, left top, left bottom, from(#888), to(#575757));
 background: -moz-linear-gradient(top,  #888,  #575757);
 filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#888888', endColorstr='#575757');
}
.gray:hover {
 background: #616161;
 background: -webkit-gradient(linear, left top, left bottom, from(#757575), to(#4b4b4b));
 background: -moz-linear-gradient(top,  #757575,  #4b4b4b);
 filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#757575', endColorstr
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值