CSS Buttons

by allusis

HTML

<div> 
    <a href="#" class="button black">Rectangle</a>  or
    <a href="#" class="button black bigrounded">Rounded</a> Can be
    <a href="#" class="button black medium">Medium</a> or 
    <a href="#" class="button black small">Small</a> 
    <br /><br /> 
    <input class="button black" type="button" value="Input Element" /> 
    <button class="button black">Button Tag</button> 
    <span class="button black">Span</span> 
    <div class="button black">Div</div> 
    <p class="button black">P Tag</p> 
    <h3 class="button black">H3</h3> 
</div> 
 
<div> 
    <a href="#" class="button gray">Gray</a> 
    <a href="#" class="button gray bigrounded">Rounded</a> 
    <a href="#" class="button gray medium">Medium</a> 
    <a href="#" class="button gray small">Small</a> 
    <br /><br /> 
    <input class="button gray" type="button" value="Input Element" /> 
    <button class="button gray">Button Tag</button> 
    <span class="button gray">Span</span> 
    <div class="button gray">Div</div> 
    <p class="button gray">P Tag</p> 
    <h3 class="button gray">H3</h3> 
</div> 
 
<div> 
    <a href="#" class="button white">White</a> 
    <a href="#" class="button white bigrounded">Rounded</a> 
    <a href="#" class="button white medium">Medium</a> 
    <a href="#" class="button white small">Small</a> 
    <br /><br /> 
    <input class="button white" type="button" value="Input Element" /> 
    <button class="button white">Button Tag</button> 
    <span class="button white">Span</span> 
    <div class="button white">Div</div> 
    <p class="button white">P Tag</p> 
    <h3 class="button white">H3</h3> 
</div> 
 
<div> 
    <a href="#" class="button orange">Orange</a> 
    <a href="#" class="button orange bigrounded">Rounded</a> 
    <a href="#" class="button orange medium">Medium</a> 
    <a href="#" class="button orange small">Small</a> 
    <br /><br /> 
    <input class="button orange" type="button" value="Input Element" /> 
    <button class="button orange">Button...

CSS

a {
    color: #339;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}
div {
    padding: 20px 0;
    border-bottom: solid 1px #ccc;
}
 
/* button 
---------------------------------------------- */
.button {
    display: inline-block;
    zoom: 1; /* zoom and *display = ie7 hack for display:inline-block */
    *display: inline;
    vertical-align: baseline;
    margin: 0 2px;
    outline: none;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font: 14px/100% Arial, Helvetica, sans-serif;
    padding: .5em 2em .55em;
    text-shadow: 0 1px 1px rgba(0,0,0,.3);
    -webkit-border-radius: .5em; 
    -moz-border-radius: .5em;
    border-radius: .5em;
    -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
    -moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.button:hover {
    text-decoration: none;
}
.button:active {
    position: relative;
    top: 1px;
}
 
.bigrounded {
    -webkit-border-radius: 2em;
    -moz-border-radius: 2em;
    border-radius: 2em;
}
.medium {
    font-size: 12px;
    padding: .4em 1.5em .42em;
}
.small {
    font-size: 11px;
    padding: .2em 1em .275em;
}
 
/* color styles 
---------------------------------------------- */
 
/* black */
.black {
    color: #d7d7d7;
    border: solid 1px #333;
    background: #333;
    background: -webkit-gradient(linear, left top, left bottom, from(#666), to(#000));
    background: -moz-linear-gradient(top,  #666,  #000);
    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#666666', endColorstr='#000000');
}
.black:hover {
    background: #000;
    background: -webkit-gradient(linear, left top, left bottom, from(#444), to(#000));
    background: -moz-linear-gradient(top,  #444,  #000);
    filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#444444', endColorstr='#000000');
}
.black:active {
    color: #666;
    background: -webkit-gradient(linear, left top, left bottom, from(#000), to(#444));
...