<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codrops &#187; button</title>
	<atom:link href="http://tympanus.net/codrops/tag/button/feed/" rel="self" type="application/rss+xml" />
	<link>http://tympanus.net/codrops</link>
	<description>Useful resources and inspiration for creative minds</description>
	<lastBuildDate>Mon, 06 Feb 2012 07:30:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Animated Buttons with CSS3</title>
		<link>http://tympanus.net/codrops/2011/11/07/animated-buttons-with-css3/</link>
		<comments>http://tympanus.net/codrops/2011/11/07/animated-buttons-with-css3/#comments</comments>
		<pubDate>Mon, 07 Nov 2011 20:04:55 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[hover]]></category>
		<category><![CDATA[transform]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=6338</guid>
		<description><![CDATA[Still hyped by the possibilities of CSS3, I want to share some CSS3 button experiments with you. The idea is to create some animated link elements with different styles, hover effects and active states.]]></description>
			<content:encoded><![CDATA[<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons.jpg" alt="AnimatedButtons" width="580" height="315" class="aligncenter size-full wp-image-6358" /></a></p>
<p><a class="demo" href="http://tympanus.net/Tutorials/AnimatedButtons/" target="_blank">View demo</a> <a class="download" href="http://tympanus.net/Tutorials/AnimatedButtons/AnimatedButtons.zip">Download source</a> </p>
<p>Still hyped by the possibilities of CSS3, I want to share some CSS3 button experiments with you. The idea is to create some animated link elements with different styles, hover effects and active states. </p>
<p>The icons used in some of the examples are by <a href="http://www.webiconset.com/" target="_blank">webiconset.com</a> and the symbol font is by <a href="http://www.justbenicestudio.com/studio/websymbols/" target="_blank">Just Be Nice</a></p>
<p>We&#8217;ll go through every example and see how the HTML structure looks and what the styles for the normal, the hover and the active states are.</p>
<p><strong>Please note that the animations/transitions will only work in browsers that support those CSS3 properties.</strong> </p>
<p><em>In order not to bloat the tutorial, I will not be using any CSS vendor prefixes. </em>The downloadable files contain them, of course.</p>
<div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div>
<h3>Example 1</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_01.jpg" alt="AnimatedButtons_01" width="580" height="360" class="aligncenter size-full wp-image-6343" /></a><br />
In this example we will create a big button with several details in it. It will have an icon, a main text, an arrow on the right side and a price that will only appear when we hover.</p>
<h4>Markup</h4>
<p>The structure is pretty straightforward: the icon will be an image and the other elements will be spans:</p>
<pre class="brush:xml">
&lt;a href="#" class="a-btn"&gt;
	&lt;span class="a-btn-slide-text"&gt;$29&lt;/span&gt;
	&lt;img src="images/icons/1.png" alt="Photos" /&gt;
	&lt;span class="a-btn-text"&gt;&lt;small&gt;Available on the Apple&lt;/small&gt; App Store&lt;/span&gt;
	&lt;span class="a-btn-icon-right"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/a&gt;
</pre>
<h4>CSS</h4>
<p>In the style we will make sure that the right transitions are set on the element that we want to animate on hover. The price will be invisible by setting its opacity to 0. Applying mulitple box shadows will allow us to create realistic effects:</p>
<pre class="brush:css">
.a-btn{
    background: linear-gradient(top, #a9db80 0%,#96c56f 100%);
    padding-left: 90px;
    padding-right: 105px;
    height: 90px;
    display: inline-block;
    position: relative;
    border: 1px solid #80ab5d;
    box-shadow:
		0px 1px 1px rgba(255,255,255,0.8) inset,
		1px 1px 3px rgba(0,0,0,0.2);
    border-radius: 4px;
    float: left;
    clear: both;
    margin: 10px 0px;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out;
}
.a-btn img{
    position: absolute;
    left: 15px;
    top: 13px;
    border: none;
    transition: all 0.3s ease-in-out;
}
.a-btn .a-btn-slide-text{
    position: absolute;
    font-size: 36px;
    top: 18px;
    left: 18px;
    color: #6d954e;
    opacity: 0;
    text-shadow: 0px 1px 1px rgba(255,255,255,0.4);
    transition: opacity 0.2s ease-in-out;
}
.a-btn-text{
    padding-top: 13px;
    display: block;
    font-size: 30px;
    text-shadow: 0px -1px 1px #80ab5d;
}
.a-btn-text small{
    display: block;
    font-size: 11px;
    letter-spacing: 1px;
}
.a-btn-icon-right{
    position: absolute;
    right: 0px;
    top: 0px;
    height: 100%;
    width: 80px;
    border-left: 1px solid #80ab5d;
    box-shadow: 1px 0px 1px rgba(255,255,255,0.4) inset;
}
.a-btn-icon-right span{
    width: 38px;
    height: 38px;
    opacity: 0.7;
    border-radius: 20px;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -20px 0px 0px -20px;
    border: 1px solid rgba(0,0,0,0.5);
    background: #4e5c50 url(../images/arrow_down.png) no-repeat center center;
    box-shadow:
        0px 1px 1px rgba(255,255,255,0.3) inset,
        0px 1px 2px rgba(255,255,255,0.5);
    transition: all 0.3s ease-in-out;
}
</pre>
<p>When hovering over the buttons we will to change their box shadow and we&#8217;ll show the price and fade out the icon:</p>
<pre class="brush:css">
.a-btn:hover{
    box-shadow:
        0px 1px 1px rgba(255,255,255,0.8) inset,
        1px 1px 5px rgba(0,0,0,0.4);
}
.a-btn:hover img{
    transform: scale(10);
    opacity: 0;
}
.a-btn:hover .a-btn-slide-text,
.a-btn:hover .a-btn-icon-right span{
    opacity: 1;
}
</pre>
<p>The active state will make the button looked pressed with an inset shadow. The arrow icon on the right will be enlarged:</p>
<pre class="brush:css">
.a-btn:active {
    position:relative;
    top:1px;
    background:#80ab5d;
    box-shadow:1px 1px 2px rgba(0,0,0,0.4) inset;
    border-color: #a9db80;
}
.a-btn:active .a-btn-icon-right span{
    transform: scale(1.4);
}
</pre>
<h3>Example 2</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index2.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_02.jpg" alt="AnimatedButtons_02" width="580" height="360" class="aligncenter size-full wp-image-6344" /></a><br />
The second example will be very similar to the first one, just that we&#8217;ll add some different effects.</p>
<h4>Markup</h4>
<p>The markup on this example will be the same like in example 1.</p>
<h4>CSS</h4>
<p>The styles are almost the same like in example 1, we will just adapt the colors. But, we will do something different on hover. We will make the price scale to its original size (before we have set it to 0) and the icon will disappear. The arrow span will get a red background color:</p>
<pre class="brush:css">
.a-btn:hover{
    box-shadow:
        0px 1px 1px rgba(255,255,255,0.8) inset,
        1px 1px 5px rgba(0,0,0,0.4);
}
.a-btn:hover img{
    opacity: 0;
}
.a-btn:hover .a-btn-slide-text{
    opacity: 1;
    transform: scale(1);
}
.a-btn:hover .a-btn-icon-right span{
    opacity: 1;
    background-color: #bc3532;
}
</pre>
<p>The active state will be the same like in the previous example. We will only change the colors. When we press the button, we will also rotate the arrow icon:</p>
<pre class="brush:css">
.a-btn:active {
    position: relative;
    top: 1px;
    background: #5d81ab;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.4) inset;
    border-color: #80a9da;
}
.a-btn:active .a-btn-icon-right span{
    transform: rotate(360deg);
}
</pre>
<h3>Example 3</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index3.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_03.jpg" alt="AnimatedButtons_03" width="580" height="256" class="aligncenter size-full wp-image-6345" /></a><br />
In this example we will try something completely different. The button will expand down on hover and reveal another message. The arrow icon will slightly rotate.</p>
<h4>Markup</h4>
<p>The markup in example 3 will be slightly different than in the previous examples. The text that will slide down will be in the span with the class &#8220;a-btn-slide-text&#8221;:</p>
<pre class="brush:xml">
&lt;a href="#" class="a-btn"&gt;
	&lt;span class="a-btn-text"&gt;Register now&lt;/span&gt;
	&lt;span class="a-btn-slide-text"&gt;Get a promotion&lt;/span&gt;
	&lt;span class="a-btn-icon-right"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/a&gt;
</pre>
<h4>CSS</h4>
<p>In the normal state the button is going to have a specific height that we&#8217;ll animate on hover in order to reveal the additional message. The additional message of &#8220;a-btn-slide-text&#8221; will be positioned absolutely and we will animate its height from 0 to 30px on hover.</p>
<pre class="brush:css">
.a-btn{
    background: linear-gradient(top, #feda71 0%,#febb4a 100%);
	border: 1px solid #f5b74e;
    border-color: #f5b74e #e5a73e #d6982f;
    box-shadow: 0 1px 1px #d3d3d3, inset 0 1px 0 #fee395;
    padding: 0px 80px 0px 10px;
	height: 38px;
	display: inline-block;
	position: relative;
	border-radius: 4px;
	float: left;
	margin: 10px;
	overflow: hidden;
	transition: all 0.3s linear;
}
.a-btn-text{
	padding-top: 5px;
	display: block;
	font-size: 18px;
	white-space: nowrap;
	color: #996633;
    text-shadow: 0 1px 0 #fedd9b;
	transition: all 0.3s linear;
}
.a-btn-slide-text{
	position:absolute;
	top: 35px;
	left: 0px;
	width: auto;
	right: 52px;
	height: 0px;
	background: #fff;
	color: #996633;
	font-size: 13px;
	white-space: nowrap;
	font-family: Georgia, serif;
	font-style: italic;
	text-indent: 15px;
	overflow: hidden;
	line-height: 30px;
	box-shadow:
		-1px 0px 1px rgba(255,255,255,0.4),
		1px 1px 1px rgba(0,0,0,0.5) inset;
	transition: height 0.3s linear;
}
.a-btn-icon-right{
	position: absolute;
	right: 0px;
	top: 0px;
	height: 100%;
	width: 52px;
	border-left: 1px solid #f5b74e;
	box-shadow: 1px 0px 1px rgba(255,255,255,0.4) inset;
}
.a-btn-icon-right span{
	width: 38px;
	height: 38px;
	opacity: 0.7;
	position: absolute;
	left: 50%;
	top: 50%;
	margin: -20px 0px 0px -20px;
	background: transparent url(../images/arrow_right.png) no-repeat 50% 55%;
    transition: all 0.3s linear;
}
</pre>
<p>On hover we will change the heights of the button and the additional text element. We&#8217;ll also rotate the arrow icon 45 degrees:</p>
<pre class="brush:css">
.a-btn:hover{
	height: 65px;
	box-shadow: 0px 1px 1px rgba(255,255,255,0.8) inset, 1px 1px 5px rgba(0,0,0,0.4);
}
.a-btn:hover .a-btn-text{
	text-shadow: 0px 1px 1px rgba(0,0,0,0.2);
	color: #fff;
}
.a-btn:hover .a-btn-slide-text{
	height: 30px;
}
.a-btn:hover .a-btn-icon-right span{
	opacity: 1;
	transform: rotate(-45deg);
}
</pre>
<p>The active state will move the button a bit and adjust the colors so that the button seems pressed:</p>
<pre class="brush:css">
.a-btn:active {
	position:relative;
	top:1px;
	background: linear-gradient(top, #fec354 0%,#fecd61 100%); /* W3C */
    border-color: #d29a3a #cc9436 #c89133;
    text-shadow: 0 1px 0 #fee1a0;
    box-shadow: 0 1px 1px #d4d4d4, inset 0 1px 0 #fed17e;
}
</pre>
<h3>Example 4</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index4.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_04.jpg" alt="AnimatedButtons_04" width="580" height="262" class="aligncenter size-full wp-image-6346" /></a><br />
In example 4, we will slide out some additional message just like in the previous example, but we will do that horizontally to the right side. This will seem as if the button opens up to reveal the message inside.</p>
<h4>Markup</h4>
<p>The Markup of this example is the same like in the previous one.</p>
<h4>CSS</h4>
<p>Similar to the previous example, the button style will be the following. What we will change is the colors and the position of the additional text element:</p>
<pre class="brush:css">
.a-btn{
    background: linear-gradient(top, #80a9da 0%,#6f97c5 100%);
    padding-left: 20px;
    padding-right: 80px;
    height: 38px;
    display: inline-block;
    position: relative;
    border: 1px solid #5d81ab;
    box-shadow:
		0px 1px 1px rgba(255,255,255,0.8) inset,
		1px 1px 3px rgba(0,0,0,0.2),
		0px 0px 0px 4px rgba(188,188,188,0.5);
    border-radius: 20px;
    float: left;
    clear: both;
    margin: 10px 0px;
    overflow: hidden;
    transition: all 0.3s linear;
}
.a-btn-text{
    padding-top: 5px;
    display: block;
    font-size: 18px;
    white-space: nowrap;
    text-shadow: 0px 1px 1px rgba(255,255,255,0.3);
    color: #446388;
    transition: all 0.2s linear;
}
.a-btn-slide-text{
    position:absolute;
    height: 100%;
    top: 0px;
    right: 52px;
    width: 0px;
    background: #63707e;
    text-shadow: 0px -1px 1px #363f49;
    color: #fff;
    font-size: 18px;
    white-space: nowrap;
    text-transform: uppercase;
    text-align: left;
    text-indent: 10px;
    overflow: hidden;
    line-height: 38px;
    box-shadow:
		-1px 0px 1px rgba(255,255,255,0.4),
		1px 1px 2px rgba(0,0,0,0.2) inset;
    transition: width 0.3s linear;
}
.a-btn-icon-right{
    position: absolute;
    right: 0px;
    top: 0px;
    height: 100%;
    width: 52px;
    border-left: 1px solid #5d81ab;
    box-shadow: 1px 0px 1px rgba(255,255,255,0.4) inset;
}
.a-btn-icon-right span{
    width: 38px;
    height: 38px;
    opacity: 0.7;
    position: absolute;
    left: 50%;
    top: 50%;
    margin: -20px 0px 0px -20px;
    background: transparent url(../images/arrow_right.png) no-repeat 50% 55%;
    transition: all 0.3s linear;
}
</pre>
<p>On hover we will increase the right padding of the button and also the width of the &#8220;a-btn-slide-text&#8221; span:</p>
<pre class="brush:css">
.a-btn:hover{
    padding-right: 180px;
    box-shadow: 0px 1px 1px rgba(255,255,255,0.8) inset, 1px 1px 3px rgba(0,0,0,0.2);
}
.a-btn:hover .a-btn-text{
    text-shadow: 0px 1px 1px #5d81ab;
    color: #fff;
}
.a-btn:hover .a-btn-slide-text{
    width: 100px;
}
.a-btn:hover .a-btn-icon-right span{
    opacity: 1;
}
</pre>
<p>The active state will again look pressed with the help of an inset shadow and an additional pixel down:</p>
<pre class="brush:css">
.a-btn:active {
    position: relative;
    top: 1px;
    background: #5d81ab;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.4) inset;
    border-color: #80a9da;
}
</pre>
<h3>Example 5</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index5.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_05.jpg" alt="AnimatedButtons_05" width="580" height="242" class="aligncenter size-full wp-image-6347" /></a><br />
In this example we will be using a symbol font for the icons. The idea is to make the displayed icon disappear and show an arrow animation while hovering.</p>
<h4>Markup</h4>
<p>The structure will consist of 4 span elements inside of the button link. The span with the class &#8220;a-btn-slide-icon&#8221; will be the animated arrow that will move from up to down.</p>
<pre class="brush:xml">
&lt;a href="#" class="a-btn"&gt;
	&lt;span class="a-btn-symbol"&gt;Z&lt;/span&gt;
	&lt;span class="a-btn-text"&gt;Download Now&lt;/span&gt;
	&lt;span class="a-btn-slide-text"&gt;Windows Vista / Windows 7&lt;/span&gt;
	&lt;span class="a-btn-slide-icon"&gt;&lt;/span&gt;
&lt;/a&gt;
</pre>
<h4>CSS</h4>
<p>Since we will be using a font to display the icons on the left side, we will have to include the font.<br />
We will hide the arrow by setting it&#8217;s top value to -30px.</p>
<pre class="brush:css">
@font-face {
    font-family: 'WebSymbolsRegular';
    src: url('websymbols/websymbols-regular-webfont.eot');
    src: url('websymbols/websymbols-regular-webfont.eot?#iefix') format('embedded-opentype'),
        url('websymbols/websymbols-regular-webfont.woff') format('woff'),
        url('websymbols/websymbols-regular-webfont.ttf') format('truetype'),
        url('websymbols/websymbols-regular-webfont.svg#WebSymbolsRegular') format('svg');
    font-weight: normal;
    font-style: normal;
}
.a-btn{
    border-radius: 50px;
    padding: 10px 30px 10px 70px;
    position: relative;
    float:left;
    display: block;
    overflow: hidden;
    margin: 10px;
    background: linear-gradient(top, rgba(255,255,255,1) 0%,rgba(246,246,246,1) 74%,rgba(237,237,237,1) 100%);
    box-shadow:
        0px 0px 7px rgba(0,0,0,0.2),
        0px 0px 0px 1px rgba(188,188,188,0.1);
    transition: box-shadow 0.3s ease-in-out;
}
.a-btn-symbol{
    font-family: 'WebSymbolsRegular', cursive;
    color: #555;
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
    position:absolute;
    left: 20px;
    line-height: 32px;
    transition: opacity 0.3s ease-in-out;
}
.a-btn-text{
    font-size: 20px;
    color: #d7565b;
    line-height: 16px;
    font-weight: bold;
    font-family: "Myriad Pro", "Trebuchet MS", sans-serif;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.5);
    display: block;
}
.a-btn-slide-text{
    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    text-shadow: 0px 1px 1px rgba(255,255,255,0.9);
}
.a-btn-slide-icon{
    position:absolute;
    top:-30px;
    width: 22px;
    height: 22px;
    background: transparent url(../images/arrow_down_black.png) no-repeat top left;
    left:20px;
    opacity: 0.4;
}
</pre>
<p>On hover we will fade out the icon on the left and play the animation for the arrow infinitely:</p>
<pre class="brush:css">
.a-btn:hover{
    background: #fff;
    box-shadow:
        0px 0px 9px rgba(0,0,0,0.4),
        0px 0px 0px 1px rgba(188,188,188,0.1);
}
.a-btn:hover .a-btn-symbol{
    opacity: 0;
}
.a-btn:hover .a-btn-slide-icon{
    -webkit-animation: slideDown 0.9s linear infinite;
}
</pre>
<p>When pressing the button, we will make the button red and look pressed by giving it an inset shadow:</p>
<pre class="brush:css">
.a-btn:active{
    background: #d7565b;
    box-shadow:
        0px 2px 2px rgba(0,0,0,0.6) inset,
        0px 0px 0px 1px rgba(188,188,188,0.1);
}
.a-btn:active .a-btn-text{
    color: #fff;
    text-shadow: 0px 1px 1px rgba(0,0,0,0.3);
}
.a-btn:active .a-btn-slide-text{
    color: rgba(0,0,0,0.4);
    text-shadow: none;
}
</pre>
<p>And finally, the simple animation for moving the arrow from up to down:</p>
<pre class="brush:css">
@keyframes slideDown {
    0% { top: -30px; }
    100% { top: 80px;}
}
</pre>
<h3>Example 6</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index6.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_06.jpg" alt="AnimatedButtons_06" width="580" height="360" class="aligncenter size-full wp-image-6348" /></a><br />
Let&#8217;s go wild here. Let&#8217;s do a circular button with a star in it! We will, of course, make the star rotate on hover (with slight pulse, oh yeah!) and make an additional text appear.</p>
<h4>Markup</h4>
<p>We will have three spans in our button link. The last one will be the hidden text that shows on hover. </p>
<pre class="brush:xml">
&lt;a href="#" class="a-btn"&gt;
	&lt;span&gt;&lt;/span&gt;
	&lt;span&gt;Sign up&lt;/span&gt;
	&lt;span&gt;It's free!&lt;/span&gt;
&lt;/a&gt;
</pre>
<h4>CSS</h4>
<p>We&#8217;ll play a bit with nth-child in this example. Since we have 3 spans, we&#8217;ll need to address them as <strong>.a-btn span:nth-child(1)</strong>, <strong>.a-btn span:nth-child(2)</strong> and <strong>.a-btn span:nth-child(3)</strong>. </p>
<p>We&#8217;ll make the button circular and add some really fancy box shadows to it. In order to center the main text vertically, we will set its display to table-cell. The star and the hidden text will be positioned absolutely.</p>
<pre class="brush:css">
.a-btn{
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: block;
    margin: 20px;
    float: left;
    background: #f0ad4e;
    position: relative;
    box-shadow:
        0px 0px 5px 0px rgba(246, 212, 163, 0.5) inset,
        0px -1px 5px 4px rgba(170, 77, 27, 0.2) inset,
        0px 0px 0px 7px #fff,
        0px 0px 1px 8px rgba(188, 188, 188, 0.4),
        0px 0px 0px 9px #fff;
    transition: all 0.3s linear;
}
.a-btn span{
    display: table-cell;
    width: 80px;
    height: 80px;
    padding: 20px;
    text-align: center;
    vertical-align: middle;
    font-size: 26px;
    color: #fff;
    text-shadow: 0px 1px 1px #A03F16;
    font-family: "Arvo", "Myriad Pro", "Trebuchet MS", sans-serif;
    transition: all 0.3s linear;
}
.a-btn span:nth-child(1),
.a-btn span:nth-child(3){
    position: absolute;
    top: 0px;
    left: 0px;
    font-size: 40px;
    line-height: 36px;
    opacity: 0;
}
.a-btn span:nth-child(1){
    background: transparent url(../images/star.png) no-repeat center center;
    opacity: 0.2;
}
</pre>
<p>On hover we will change the box shadow of the button so that it appears lifted. The hidden text will be faded in and we&#8217;ll apply the flyOut animation to the initial text. We&#8217;ll apply the rotate animation to the star:</p>
<pre class="brush:css">
.a-btn:hover{
    background: rgba(170, 77, 27, 0.6);
    box-shadow:
        0px 0px 5px 0px rgba(246, 212, 163, 0.5) inset,
        0px -1px 5px 4px rgba(170, 77, 27, 0.2) inset,
        0px 0px 0px 7px #fff,
        1px 4px 5px 8px rgba(188, 188, 188, 0.6),
        0px 0px 0px 9px #fff;
}
.a-btn:hover span:nth-child(3){
    opacity: 1;
}
.a-btn:hover span:nth-child(2){
        transform: scale(0);
    opacity: 0;
}
.a-btn:hover span:nth-child(1){
    animation: rotate 1s linear;
}
</pre>
<p>Let&#8217;s make the button look pressed when clicking on it:</p>
<pre class="brush:css">
.a-btn:active{
    box-shadow:
        0px 0px 5px 0px rgba(246, 212, 163, 0.5) inset,
        0px -1px 5px 4px rgba(170, 77, 27, 0.2) inset,
        0px 0px 0px 7px #fff,
        0px -1px 0px 8px rgba(188, 188, 188, 0.3),
        0px 0px 0px 10px #fff;
}
.a-btn:active span:nth-child(2){
    color: rgba(170, 77, 27, 0.8);
    text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.6);
}
</pre>
<p>The rotate/pulse animation looks as follows:</p>
<pre class="brush:css">
@-webkit-keyframes rotate{
    0% { transform: scale(1) rotate(0);}
    50% { transform: scale(0.5) rotate(180deg);}
    100% { transform: scale(1) rotate(360deg);}
}
</pre>
<h3>Example 7</h3>
<p><a href="http://tympanus.net/Tutorials/AnimatedButtons/index7.html" target="_blank"><img src="http://tympanus.net/codrops/wp-content/uploads/2011/11/AnimatedButtons_07.jpg" alt="AnimatedButtons_07" width="580" height="254" class="aligncenter size-full wp-image-6349" /></a><br />
In the last example we&#8217;ll create a bit of a 3D look by the use of some nifty box shadow.</p>
<h4>Markup</h4>
<p>The structure will be the same like in example 5.</p>
<h4>CSS</h4>
<p>The style will be very similar to example 5, we&#8217;ll just adjust some colors and shadows:</p>
<pre class="brush:css">
.a-btn{
    border-radius: 10px;
    padding: 10px 30px 10px 70px;
    position: relative;
    float:left;
    display: block;
    overflow: hidden;
    margin: 10px;
    background: linear-gradient(top, #b7f2f4 0%,#7ce7ea 100%);
    border: 1px solid #90c6c8;
    border-color: #90c6c8 #78bdc0 #65b6ba;
    box-shadow:
		0px -5px 0px 0px #458a8c,
		0 1px 1px #d5d5d5,
		0 1px 0 rgba(255,255,255,0.8) inset;
    transition: all 0.2s linear;
}
.a-btn-symbol{
    font-family: 'WebSymbolsRegular', cursive;
    color: #437b7d;
    text-shadow: 0 1px 0 #bef3f5;
    font-size: 20px;
    position:absolute;
    left: 20px;
    width: 20px;
    text-align: center;
    line-height: 32px;
    transition: all 0.3s ease-in-out;
}
.a-btn-text{
    font-size: 20px;
    color: #437b7d;
    text-shadow: 0 1px 0 #bef3f5;
    line-height: 16px;
    font-weight: bold;
    font-family: "Myriad Pro", "Trebuchet MS", sans-serif;
    display: block;
}
.a-btn-slide-text{
    font-family: Arial, sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    text-shadow: 0px 1px 1px rgba(255,255,255,0.9);
}
</pre>
<p>On hover we will enlarge the button and rotate the little icon:</p>
<pre class="brush:css">
.a-btn:hover{
    transform: scale(1.05);
}
.a-btn:hover .a-btn-symbol{
    opacity: 0.5;
    transform: rotate(360deg);
}
</pre>
<p>When clicking the button, we will make the button smaller and press it by adjusting the box shadow:</p>
<pre class="brush:css">
.a-btn:active{
    transform: scale(0.95);
    box-shadow:
        0px 0px 0px 1px #458a8c,
        0 1px 1px #d5d5d5, inset 0 1px 0 rgba(255,255,255,0.8),
        0px 1px 1px 2px #fff;
}
</pre>
<p>And that&#8217;s it! I hope you enjoyed creating some crazy buttons with CSS3 and got inspired!</p>
<h3>Some References</h3>
<p><a href="http://www.premiumpixels.com/freebies/add-to-cart-buttons-psd/" target="_blank">Add to Cart Buttons (PSD)</a><br />
<a href="http://www.lab.tommasoraspo.com/simple-web-buttoms/index.html" target="_blank">Simple CSS3 Button</a><br />
<a href="http://www.colorzilla.com/gradient-editor/" target="_blank">Ultimate CSS Gradient Generator </a></p>
<p><a class="demo" href="http://tympanus.net/Tutorials/AnimatedButtons/" target="_blank">View demo</a> <a class="download" href="http://tympanus.net/Tutorials/AnimatedButtons/AnimatedButtons.zip">Download source</a> </p>
<div class="googlead"><!-- wp_ad_camp_1 --></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2011/11/07/animated-buttons-with-css3/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
		<item>
		<title>Awesome CSS3 &amp; jQuery Slide Out Button</title>
		<link>http://tympanus.net/codrops/2010/02/08/awesome-css3-jquery-slide-out-button/</link>
		<comments>http://tympanus.net/codrops/2010/02/08/awesome-css3-jquery-slide-out-button/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 13:25:37 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slide out]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=1293</guid>
		<description><![CDATA[Here is an awesome little slide out button. The inspiration for that button came from photoshop.com where Flash is used to create a nice slide out effect. This button does not behave exactly the same, but the effect is quite neat. It does not use any images and uses the border radius property to make [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.tympanus.net/Tutorials/SlideOutButton/" target="_blank"><img class="size-full wp-image-1298 aligncenter" title="slideoutbutton" src="http://tympanus.net/codrops/wp-content/uploads/2010/02/slideoutbutton.png" alt="slideoutbutton" width="500" height="380" /></a></p>
<p>Here is an awesome little slide out button. The inspiration for that button came from <a href="https://www.photoshop.com/" target="_blank">photoshop.com</a> where Flash is used to create a nice slide out effect. This button does not behave exactly the same, but the effect is quite neat. It does not use any images and uses the border radius property to make the rounded borders.</p>
<p>The button consists of three parts: a container, the little button and the longer button. The two inner parts have absolute positioning. With jQuery, we enlarge the long button and change the colors of the small one.</p>
<p>Enjoy it!</p>
<p><a class="demo" href="http://www.tympanus.net/Tutorials/SlideOutButton/" target="_blank">View demo</a><a class="download" href="http://www.tympanus.net/Tutorials/SlideOutButton/SlideOutButton.zip">Download source</a></p>
<p><div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div><br />
<br/><br/><br/></p>
<div class="partner_section_post"><span>Message from Testking</span>Learning of jquery-plugin can be fun with our <a href="http://www.pass4sure.com/640-802.html">640-802</a> tutorials. Learn JQuery to create impressive slide out buttons using <a href="http://www.pass4sure.com/350-001.html">350-001</a> dumps and <a href="http://www.pass4sure.com/642-902.html">642-902</a> guide.</div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2010/02/08/awesome-css3-jquery-slide-out-button/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>CSS button with hover effect</title>
		<link>http://tympanus.net/codrops/2009/08/31/css-button-with-hover-effect/</link>
		<comments>http://tympanus.net/codrops/2009/08/31/css-button-with-hover-effect/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 19:51:29 +0000</pubDate>
		<dc:creator>Mary Lou</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[hover]]></category>

		<guid isPermaLink="false">http://tympanus.net/codrops/?p=121</guid>
		<description><![CDATA[Inspired by the nice download button on the jquery homepage I created this button with a hover effect. It uses opacity options for all browsers. You can see a demo here: JButton Demo Download the zip with all the containing files here: JButton The style for the button consists of the following classes: a.jbutton{ background: [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by the nice download button on the <a title="jquery" href="http://www.jquery.com" target="_blank">jquery</a> homepage I created this button with a hover effect. It uses opacity options for all browsers. You can see a demo here: <a href="http://tympanus.net/codrops/wp-content/uploads/2009/08/JButton/button.html">JButton Demo</a></p>
<div id="attachment_122" class="wp-caption alignnone" style="width: 215px"><a href="http://tympanus.net/codrops/wp-content/uploads/2009/08/JButton/button.html"><img class="size-full wp-image-122 " title="jbuttonscreen" src="http://tympanus.net/codrops/wp-content/uploads/2009/08/jbuttonscreen.png" alt="jbuttonscreen" width="205" height="72" /></a><p class="wp-caption-text">Click to see a DEMO of the button</p></div>
<p><span id="more-121"></span>Download the zip with all the containing files here: <a href="http://tympanus.net/codrops/wp-content/uploads/2009/08/JButton.zip">JButton</a></p>
<p>The style for the button consists of the following classes:</p>
<pre class="brush: css">a.jbutton{
 background: transparent url(buttonleft.png) no-repeat top left;
 display: block;
 float: left;
 font: 22px "Tahoma";
 line-height: 49px; /* This value + 8px should equal height of the button */
 height: 57px;
 padding-left: 9px; /* Left part of image */
 text-decoration: none;
 outline:none;
 color:white;
 cursor:pointer;
 filter:progid:DXImageTransform.Microsoft.Alpha(opacity=100);
 opacity: 1;
 -moz-opacity: 0.99;
}
a.jbutton span{
 background: transparent url(buttonright.png) no-repeat top right;
 display: block;
 padding: 4px 9px 6px 0; /*Set right padding here to 'padding-left' value above*/
 text-shadow: -1px 0 black, 0 1px black, 1px 0 black, 0 -1px black;
}
a.jbutton:link, a.jbutton:visited{
 color: #F0F0F0; /* button text color */
}
a.jbutton:hover{
 filter:progid:DXImageTransform.Microsoft.Alpha(opacity=80);
 opacity: 0.8;
 -moz-opacity: 0.8;
}
a.jbutton:hover span{
 color: #FFFFFF;
}</pre>
<p>We have two images, the left and the right side of the button. Depending on the size of the text, the button will expand (up to 200px).</p>
<p>I also added some text shadow which will not work in IE though.</p>
<p>The html is very simple:</p>
<pre class="brush: html">&lt;a class="jbutton"&gt;&lt;span&gt; &amp;#157; Ask a question&lt;/span&gt;&lt;/a&gt;</pre>
<p>The special character is a the question mark which I just added for fun.</p>
<p>Enjoy!</p>
<div id="bsap_1266918" class="bsarocks bsap_af25dfd2f1908889af7a1aa5f4dcbd9e"></div><div style="clear:both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://tympanus.net/codrops/2009/08/31/css-button-with-hover-effect/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- This Quick Cache file was built for (  tympanus.net/codrops/tag/button/feed/ ) in 0.23162 seconds, on Feb 7th, 2012 at 12:26 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 7th, 2012 at 1:26 pm UTC -->
