Skip to content

Instantly share code, notes, and snippets.

@jrudenstam
Created April 23, 2012 09:09
Show Gist options
  • Save jrudenstam/2469715 to your computer and use it in GitHub Desktop.
Save jrudenstam/2469715 to your computer and use it in GitHub Desktop.
CSS demo
/**
* CSS demo
*/
@keyframes demo {
0%{
margin-left: 0;
width: 0;
}
50%{
margin-left: 40px;
width: 0;
color: #333;
}
90%{
margin-left: 20px;
width: 960px;
}
100%{
margin-left: 0;
width: 0;
}
}
body{
background: #eee;
font: 14px sans-serif;
padding: 40px 0;
text-shadow: 1px 1px 0 #fff;
}
.global-width {
clear: both;
width: 960px;
margin: 0 auto;
}
.button {
background-color: #fff;
background-image: linear-gradient(rgba(255,200,30,0.5), rgba(255,100,30,0.5));
border-style: solid;
border-width: 1px;
border-color: rgba(255,255,255,0.7) rgba(0,0,0,0.2) rgba(0,0,0,0.2) rgba(255,255,255,0.4);
box-shadow: 0 0 3px rgba(0,0,0,0.2);
color: rgba(58,128,80,1);
border-radius: 3px;
padding: 10px;
text-decoration: none;
text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
letter-spacing: 0.1em;
}
.button:hover {
background-color: #ccc;
border-color: rgba(200,200,200,0.1) rgba(255,255,255,0.5) rgba(255,255,255,0.5) rgba(0,0,0,0.2);
box-shadow: none;
border-radius: 5px;
text-shadow: -1px -1px 0 rgba(255,255,255,0.3);
}
h1 {
background-color: #fe5;
padding: 20px 0 20px 40px;
color: #f5f5f5;
width: 0;
overflow: hidden;
}
.disabled {
background: #bbb;
color: #999;
}
.transition h1 {
transition: all 1s cubic-bezier(.5,1.5,0,1);
}
.transition h1:hover {
color: #333;
width: 960px;
}
.transition .button {
transition: all 0.25s linear 0.25s;
}
.animation h1:hover {
animation: demo 2s infinite;
}
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1; }
<section class="global-width none">
<h1>None</h1>
<a class="button" href="http://www.google.com">Push me</a>
<a class="button disabled" href="http://www.google.com">Push me</a>
</section>
<section class="global-width transition">
<h1>Transition</h1>
<a class="button" href="http://www.google.com">Push me</a>
<a class="button disabled" href="http://www.google.com">Push me</a>
</section>
<section class="global-width animation">
<h1>Animation</h1>
<a class="button" href="http://www.google.com">Push me</a>
<a class="button disabled" href="http://www.google.com">Push me</a>
</section>
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment