Skip to content

Instantly share code, notes, and snippets.

@centurianii
Last active January 3, 2016 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save centurianii/8516819 to your computer and use it in GitHub Desktop.
Save centurianii/8516819 to your computer and use it in GitHub Desktop.
Button backgrounds
/**
* Button backgrounds
*/
.boxes {
list-style: none outside none;
margin: 10px auto;
overflow: hidden;
padding: 0px;
width: 300px;
}
.boxes li {
cursor: pointer;
float: left;
height: 60px;
margin: 10px;
transition: background-color 0.2s ease-out 0s;
width: 300px;
}
.boxes .gray {
background-color: #808080;
}
.boxes .gray:hover {
background-color: #cccccc;
}
.boxes-1 li {
background-image: -moz-linear-gradient(center top , rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
}
.boxes-2 li {
box-shadow: 0px 60px 50px -30px rgba(255, 255, 255, 0.5) inset;
}
<h3>Normal box</h3>
<ul class="boxes">
<li class="gray">Background color</li>
</ul>
<br>
<h3>Using semi transparent background</h3>
<ul class="boxes boxes-1">
<li class="gray">Background image</li>
</ul>
<br>
<h3>Using inset shadow</h3>
<ul class="boxes boxes-2">
<li class="gray">Inset shadow</li>
</ul>
<a href="http://www.red-team-design.com/faking-transitions-on-gradients">www.red-team-design.com</a>
// alert('Hello world!');
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment