H5代码
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>36种漂亮的CSS3网页按钮Button样式</title>
<style type="text/css">
body{
background:
}
.demo_con{
width: 960px;
margin:40px auto 0;
}
.button{
width: 140px;
line-height: 38px;
text-align: center;
font-weight: bold;
color:
text-shadow:1px 1px 1px
border-radius: 5px;
margin:0 20px 20px 0;
position: relative;
overflow: hidden;
}
.button:nth-child(6n){
margin-right: 0;
}
.button.gray{
color:
text-shadow:1px 1px 1px
border:1px solid
box-shadow: 0 1px 2px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.button.black{
border:1px solid
box-shadow: 0 1px 2px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.button.red{
border:1px solid
box-shadow: 0 1px 2px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.button.yellow{
border:1px solid
box-shadow: 0 1px 2px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.button.green{
border:1px solid
box-shadow: 0 1px 2px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.button.blue{
border:1px solid
box-shadow: 0 1px 2px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.round,
.side,
.tags{
padding-right: 30px;
}
.round:after{
position: absolute;
display: inline-block;
content: "\003c";
top:50%;
right:10px;
margin-top: -10px;
width: 17px;
height: 20px;
padding-left: 3px;
line-height:18px;
font-size: 10px;
font-weight: normal;
border-radius: 10px;
text-shadow:-2px 0 1px
-webkit-transform:rotate(-90deg);
-moz-transform:rotate(-90deg);
transform:rotate(-90deg);
}
.gray.round:after{
box-shadow:1px 0 1px rgba(255,255,255,1) inset,1px 0 1px rgba(0,0,0,.2);
background:-webkit-linear-gradient(top,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
text-shadow:-2px 0 1px
}
.black.round:after{
box-shadow:1px 0 1px rgba(255,255,255,.5) inset,1px 0 1px rgba(0,0,0,.9);
background:-webkit-linear-gradient(top,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
}
.red.round:after{
box-shadow:1px 0 1px rgba(255,255,255,.6) inset,1px 0 1px rgba(130,25,25,.9);
background:-webkit-linear-gradient(top,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
}
.yellow.round:after{
box-shadow:1px 0 1px rgba(255,255,255,.8) inset,1px 0 1px rgba(148,131,4,.9);
background:-webkit-linear-gradient(top,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
}
.green.round:after{
box-shadow:1px 0 1px rgba(255,255,255,.8) inset,1px 0 1px rgba(51,126,66,.9);
background:-webkit-linear-gradient(top,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
}
.blue.round:after{
box-shadow:1px 0 1px rgba(255,255,255,.8) inset,1px 0 1px rgba(18,85,128,.9);
background:-webkit-linear-gradient(top,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
}
.side:after{
position: absolute;
display: inline-block;
content: "\00bb";
top:3px;
right:-4px;
width: 38px;
height:30px;
font-weight: normal;
line-height: 26px;
border-radius:0 0 5px 5px;
text-shadow:-2px 0 1px
-webkit-transform:rotate(-90deg);
-moz-transform:rotate(-90deg);
transform:rotate(-90deg);
}
.gray.side:after{
text-shadow:-2px 0 1px
border-top: 1px solid
box-shadow:-2px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.black.side:after{
border-top: 1px solid
box-shadow:-2px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.red.side:after{
border-top: 1px solid
box-shadow:-2px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(top,
background:linear-gradient(top,
}
.yellow.side:after{
border-top: 1px solid
box-shadow:-2px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.green.side:after{
border-top: 1px solid
box-shadow:-2px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.blue.side:after{
border-top: 1px solid
box-shadow:-2px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.tags:after{
font-weight: normal;
position: absolute;
display: inline-block;
content: "FREE";
top:-3px;
right: -33px;
color:
text-shadow:none;
width: 85px;
height:25px;
line-height: 28px;
-webkit-transform:rotate(45deg) scale(.7,.7);
-moz-transform:rotate(45deg) scale(.7,.7);
transform:rotate(45deg) scale(.7,.7);
}
.gray.tags:after{
background:
border:2px solid
}
.black.tags:after{
background:
border:2px solid
}
.red.tags:after{
background:
border:2px solid
}
.yellow.tags:after{
background:
border:2px solid
}
.green.tags:after{
background:
border:2px solid
}
.blue.tags:after{
background:
border:2px solid
}
.button.rarrow,
.button.larrow{
overflow:visible;
}
.rarrow:after,
.rarrow:before,
.larrow:after,
.larrow:before{
position:absolute;
content: "";
display: block;
width: 28px;
height: 28px;
-webkit-transform:rotate(45deg);
-moz-transform:rotate(45deg);
transform:rotate(45deg);
}
.rarrow:before{
width: 27px;
height: 27px;
top: 6px;
right: -13px;
clip: rect(auto auto 26px 2px);
}
.rarrow:after{
top: 6px;
right: -12px;
clip: rect(auto auto 26px 2px);
}
.gray.rarrow:before{
background:
}
.gray.rarrow:after{
box-shadow: 0 1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.black.rarrow:before{
background:
}
.black.rarrow:after{
box-shadow: 0 1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.red.rarrow:before{
background:
}
.red.rarrow:after{
box-shadow: 0 1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.yellow.rarrow:before{
background:
}
.yellow.rarrow:after{
box-shadow: 0 1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.green.rarrow:before{
background:
}
.green.rarrow:after{
box-shadow: 0 1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.blue.rarrow:before{
background:
}
.blue.rarrow:after{
box-shadow: 0 1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.larrow:before{
top: 6px;
left: -13px;
width: 27px;
height: 27px;
clip: rect(2px 26px auto auto);
}
.larrow:after{
top: 6px;
left: -12px;
clip: rect(2px 26px auto auto);
}
.gray.larrow:before{
background:
}
.gray.larrow:after{
box-shadow: 0 -1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.black.larrow:before{
background:
}
.black.larrow:after{
box-shadow: 0 -1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.red.larrow:before{
background:
}
.red.larrow:after{
box-shadow: 0 -1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.yellow.larrow:before{
background:
}
.yellow.larrow:after{
box-shadow: 0 -1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.green.larrow:before{
background:
}
.green.larrow:after{
box-shadow: 0 -1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.blue.larrow:before{
background:
}
.blue.larrow:after{
box-shadow: 0 -1px 0
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.gray:hover{
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.black:hover{
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.red:hover{
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.yellow:hover{
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.green:hover{
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.blue:hover{
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.gray:active{
top:1px;
box-shadow: 0 1px 3px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.black:active{
top:1px;
box-shadow: 0 1px 3px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.red:active{
top:1px;
box-shadow: 0 1px 3px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.yellow:active{
top:1px;
box-shadow: 0 1px 3px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.green:active{
top:1px;
box-shadow: 0 1px 3px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.blue:active{
top:1px;
box-shadow: 0 1px 3px
background: -webkit-linear-gradient(top,
background: -moz-linear-gradient(top,
background: linear-gradient(top,
}
.gray.side:hover:after{
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.black.side:hover:after{
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.red.side:hover:after{
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.yellow.side:hover:after{
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.green.side:hover:after{
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.blue.side:hover:after{
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.gray.side:active:after{
top:4px;
border-top: 1px solid
box-shadow:-1px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.black.side:active:after{
box-shadow:-1px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.red.side:active:after{
box-shadow:-1px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.yellow.side:active:after{
box-shadow:-1px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.green.side:active:after{
box-shadow:-1px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.blue.side:active:after{
box-shadow:-1px 0 1px
background:-webkit-linear-gradient(right,
background:-moz-linear-gradient(right,
background:linear-gradient(right,
}
.gray.rarrow:hover:after,
.gray.rarrow:hover:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.black.rarrow:hover:after,
.black.larrow:hover:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.red.rarrow:hover:after,
.red.larrow:hover:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.yellow.rarrow:hover:after,
.yellow.larrow:hover:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.green.rarrow:hover:after,
.green.larrow:hover:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.blue.rarrow:hover:after,
.blue.larrow:hover:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.gray.rarrow:active:after,
.gray.larrow:active:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.black.rarrow:active:after,
.black.larrow:active:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.red.rarrow:active:after,
.red.larrow:active:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.yellow.rarrow:active:after,
.yellow.larrow:active:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.green.rarrow:active:after,
.green.larrow:active:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.blue.rarrow:active:after,
.blue.larrow:active:after{
background:-webkit-linear-gradient(top left,
background:-moz-linear-gradient(top left,
background:linear-gradient(top left,
}
.gray.rarrow:active:after{
box-shadow: 0 1px 0
}
.gray.larrow:active:after{
box-shadow: 0 -1px 0
}
.black.rarrow:active:after{
box-shadow: 0 1px 0
}
.black.larrow:active:after{
box-shadow: 0 -1px 0
}
.red.rarrow:active:after{
box-shadow: 0 1px 0
}
.red.larrow:active:after{
box-shadow: 0 -1px 0
}
.yellow.rarrow:active:after{
box-shadow: 0 1px 0
}
.yellow.larrow:active:after{
box-shadow: 0 -1px 0
}
.green.rarrow:active:after{
box-shadow: 0 1px 0
}
.green.larrow:active:after{
box-shadow: 0 -1px 0
}
.blue.rarrow:active:after{
box-shadow: 0 1px 0
}
.blue.larrow:active:after{
box-shadow: 0 -1px 0
}
</style>
</head>
<body>
<div class="page">
<header id="header">
<hgrounp class="white blank">
<h1>36 Web Buttons</h1>
</hgrounp>
</header>
<section class="demo">
<div class="demo_con">
<button type="button" class="button gray">BUY NOW</button>
<button type="button" class="button black">BUY NOW</button>
<button type="button" class="button red">BUY NOW</button>
<button type="button" class="button yellow">BUY NOW</button>
<button type="button" class="button green">BUY NOW</button>
<button type="button" class="button blue">BUY NOW</button>
<button type="button" class="button gray round">DOWNLOAD</button>
<button type="button" class="button black round">DOWNLOAD</button>
<button type="button" class="button red round">DOWNLOAD</button>
<button type="button" class="button yellow round">DOWNLOAD</button>
<button type="button" class="button green round">DOWNLOAD</button>
<button type="button" class="button blue round">DOWNLOAD</button>
<button type="button" class="button gray side">DOWNLOAD</button>
<button type="button" class="button black side">DOWNLOAD</button>
<button type="button" class="button red side">DOWNLOAD</button>
<button type="button" class="button yellow side">DOWNLOAD</button>
<button type="button" class="button green side">DOWNLOAD</button>
<button type="button" class="button blue side">DOWNLOAD</button>
<button type="button" class="button gray tags">SIGN UP</button>
<button type="button" class="button black tags">SIGN UP</button>
<button type="button" class="button red tags">SIGN UP</button>
<button type="button" class="button yellow tags">SIGN UP</button>
<button type="button" class="button green tags">SIGN UP</button>
<button type="button" class="button blue tags">SIGN UP</button>
<button type="button" class="button gray rarrow">LEARN MORE</button>
<button type="button" class="button black rarrow">LEARN MORE</button>
<button type="button" class="button red rarrow">LEARN MORE</button>
<button type="button" class="button yellow rarrow">LEARN MORE</button>
<button type="button" class="button green rarrow">LEARN MORE</button>
<button type="button" class="button blue rarrow">LEARN MORE</button>
<button type="button" class="button gray larrow">GO BACK</button>
<button type="button" class="button black larrow">GO BACK</button>
<button type="button" class="button red larrow">GO BACK</button>
<button type="button" class="button yellow larrow">GO BACK</button>
<button type="button" class="button green larrow">GO BACK</button>
<button type="button" class="button blue larrow">GO BACK</button>
</div>
</section>
</div>
</body>
</html>
在线样式查看使用菜鸟工具
https://c.runoob.com/front-end/61/
效果图