使用动态伪类选择器美化按钮

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>使用动态伪类选择器美化按钮</title>
<style type="text/css">
*{
text-align: center;
}
/*默认状态下的按钮效果*/
.btn{
background-color: #0074cc;
*backgroud-color: #0075cc;
/*CSS3渐变制作背景图片*/
background-image:linear-gradient(top,#0088cc,#0055cc);
background-repeat: repeat-x;
display: inline-block;
*display:inline;
border: 1px solid #ccc;
*border:0;
border-color: #ccc;
/*CSS的色彩模块*/
border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);
border-radius: 6px;
color: #ffffff;
cursor: pointer;
/* pointer 光标呈现为指示链接的指针(一只手)*/
font-size: 20px;

text-decoration: none;
/*去掉下划线
*/
font-weight: normal;
padding: 14px 24px;
text-align: center;
/* CSS文字阴影特性*/
text-shadow: 0 -1px 0 rgb(0,0,0,0.25);
vertical-align: middle;
*zoom:1;
}
/* 悬浮状态下按钮效果*/
.btn:hover{
background-position: 0 -15px;
background-color: #0055cc;
*bakground-color:#004ab3;
color: #ffffff;
text-decoration: none;
text-shadow: 0 -1px 0 rgba(0,0,0,0.25);
/* CSS动画效果*/
transition: background-position 0.1s linear;

}
/* 点击时按钮效果*/
.btn:active{
background-color: #0055cc;
background-color: #004099 \9;
background-image: none;
outline: 0;
/* CSS盒子阴影特性*/
box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
color: rgba(255,255,255,0.75);
}
/* 获得焦点按钮效果*/
.btn:focus{
outline: thin dotted #333;
outline: 5px auto;
outline-offset: -2px;
}
</style>
</head>

<body>
<div>
<a href="#" class="btn">View project on GitHub</a>
</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/lwl520/p/8973846.html
今日推荐