分类
WEB++技术

css3气泡

<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8" />
<title>css3_bubbles</title>
<style type="text/css">
body{margin:0;padding:0;font-size:14px;background-color:#3c5a76;}
a:hover{text-decoration:none;}
.css3_bubbles{position:relative;display:block;margin:30px auto 0;width:250px;height:100px;text-align:center;background-color:#2daebf;color:#222;text-decoration:none;font:16px/52px "Century Gothic",Georgia,simsun,sans-serif;border:1px solid #2A3F56;outline-color:#3c5a76;
/*---阴影---*/
-moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, .6);-webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, .6);box-shadow:inset 0 1px 1px rgba(255, 255, 255, .6);
/*---圆角---*/
-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;
/*---渐变背景---*/
background: -webkit-linear-gradient(top, #2daebf, #238693);
background: -moz-linear-gradient(top, #2daebf, #238693);
background: -o-linear-gradient(top, #2daebf, #238693);
/*---文字投影---*/
text-shadow: rgba(255,255,255,.4) 0 1px 0;
}
.css3_bubbles:before,
.css3_bubbles:after{position:absolute;bottom:-21px;left:40px;width:0;content:"";border-style:solid;border-color:#2a3f56 transparent;border-width:20px 20px 0}
.css3_bubbles:after{bottom:-20px;left:40px;border-color:#238693 transparent;}
/*------滑过状态------*/
.css3_bubbles:hover{
background-color:#38bdce;
background: -webkit-linear-gradient(top, #38bdce, #258a97);
background: -moz-linear-gradient(top, #38bdce, #258a97);
background: -o-linear-gradient(top, #38bdce, #258a97);
}
.css3_bubbles:hover:after{border-color:#258a97 transparent;}
 
/*---带阴影---*/
.bubbles_shadow{position:relative;display:block;margin:30px auto 0;width:250px;height:100px;text-align:center;background-color:#2daebf;color:#222;text-decoration:none;font:16px/52px "Century Gothic",Georgia,simsun,sans-serif;outline-color:#3c5a76;
text-shadow: rgba(255,255,255,.4) 0 1px 0;
-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;
-moz-box-shadow:inset 0 1px 1px rgba(255, 255, 255, .6),0 0 3px rgba(0, 0, 0, .6);-webkit-box-shadow:inset 0 1px 1px rgba(255, 255, 255, .6),0 0 3px rgba(0, 0, 0, .6);box-shadow:inset 0 1px 1px rgba(255, 255, 255, .6),0 0 3px rgba(0, 0, 0, .6);
}
.bubbles_shadow:before{position:absolute;content:"";width:28px;height:28px;border:0 none;background-color:#2daebf;bottom:-14px;left:46px;
-webkit-transform:rotate(45deg);-moz-transform: rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg);
-moz-box-shadow:2px 2px 2px rgba(0, 0, 0, .3);-webkit-box-shadow:2px 2px 2px rgba(0, 0, 0, .3);box-shadow:2px 2px 2px rgba(0, 0, 0, .3);}
 
.bubbles_shadow:hover,
.bubbles_shadow:hover:before{background-color:#258a97}
 
/*---框---*/
.bubbles_border{position:relative;display:block;margin:30px auto 0;width:250px;height:100px;text-align:center;background-color:#258a97;color:#222;text-decoration:none;font:16px/52px "Century Gothic",Georgia,simsun,sans-serif;border:5px solid #2A3F56;outline-color:#3c5a76;
/*---圆角---*/
-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;
/*---文字投影---*/
text-shadow: rgba(255,255,255,.4) 0 1px 0;
}
.bubbles_border:before,
.bubbles_border:after{position:absolute;bottom:-27px;left:44px;width:0;content:"";border-style:solid;border-color:#2a3f56 transparent;border-width:26px 26px 0}
.bubbles_border:after{border-width:20px 20px 0;bottom:-20px;left:50px;border-color:#258a97 transparent;}
/*------滑过状态------*/
.bubbles_border:hover{
background-color:#2daebf;
border-color:#314963;
}
.bubbles_border:hover:after{border-color:#2daebf transparent;}
.bubbles_border:hover:before{border-color:#314963 transparent;}
 
/*---加上一点动画---*/
.css3_bubbles:hover,
.bubbles_shadow:hover,
.bubbles_border:hover{
        -webkit-animation-name: ani;
        -webkit-animation-duration: .5s;
}
@-webkit-keyframes ani{
        25%{left:-10px;top:-5px;opacity:.5;}
        50%{opacity:.25;}
        75%{left:10px;top:5px;opacity:.5;}
        100%{left:0;top:0opacity:1;}
}
</style>
</head>
<body>
<a href="#" title="" class="css3_bubbles">
css3-bubbles
</a>
<br /><br />
<a href="#" title="" class="bubbles_shadow">
css3-bubbles with shadow
</a>
 
<br /><br />
<a href="#" title="" class="bubbles_border">
bubbles border
</a>
</body>
</html>

unicac

...long long ago,he have a dream.

发表评论

邮箱地址不会被公开。 必填项已用*标注