Sunday, 27 May 2012

Button compress and release

This is a nice but not new effect in CSS. The main thing to notice in the code is that the output looks like a button but it is written in <a> tag. Using CSS I have provided a background block and color and webkit transition is used to create this type of effect.
on image.

#CODE#
<html>
<head>
<title> css button compress-release</title>
<style text="text/css">
a.hupt:link {
color: #6E6E6E;
font: bold 12px Helvetica, Arial, sans-serif;
text-decoration: none;
padding: 7px 12px;
position: relative;
display: inline-block;
text-shadow: 0 1px 0 white;
-webkit-transition: border-color .218s;
-moz-transition: border .218s;
-o-transition: border-color .218s;
transition: border-color .218s;
background: #F3F3F3;
background: -webkit-gradient(linear,0% 40%,0% 70%,from(whiteSmoke),to(#F1F1F1));
background: -moz-linear-gradient(linear,0% 40%,0% 70%,from(whiteSmoke),to(#F1F1F1));
border: solid 1px gainsboro;
border-radius: 2px;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
margin-right: 10px;
text-align: center;
width: 70px;
transition: width 1s;
-moz-transition: width 1s;
-webkit-transition: width 1s;
-o-transition: width 1s;
}


a.hupt:hover {
color: #333;
border-color: #999;
-moz-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2) -webkit-box-shadow:0 2px 5px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
width: 160px;
}
</style>


</head>
<body>
<center>
<a class="hupt" href=""> AVIXIT</a>
</body>
</html>

Demo :



*Hit a comment if you like this.

0 comments:

Post a Comment

This provides free backlink for you so feel free to comment and get a free backlink.