Today I created a CSS Button Generator to make it easier to make buttons on the fly. It also allows me to see results of my changes instantly. For this little project I used JQuery and JQuery UI frameworks as well as a MiniColors plugin for the colorpickers. Overall it is quite handy but could use a few more options. I figured I could just tweek the CSS the way I wanted after I had a roughed in button. Click the image for a demo:

Basically, you just update each property and the CSS in the center will be automatically updated. When finished, you just copy the CSS to you .css file and then use the .button class with your links or buttons. Like so,
<a href="yoursite.com" class="button">yoursite.com</a>
That is all there is too it. If you are curious how I wrote the generator, there are a couple of weird things in the code but here it is.
HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Button Generator</title>
<link rel="stylesheet" type="text/css" href="css/button.css" />
<link type="text/css" href="css/smoothness/jquery-ui-1.8.24.custom.css" rel="stylesheet" />
<link type="text/css" href="miniColors/jquery.miniColors.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.24.custom.min.js"></script>
<script type="text/javascript" src="miniColors/jquery.miniColors.min.js"></script>
<script type="text/javascript" src="js/buttonBuilder.js"></script>
</head>
<body>
<div id="top">
<div class="padder">
<h1>CSS Button Generator</h1>
<p>CSS buttons are extremely versatile.
They are not only leaner than a image style button, requiring less bandwidth,
but also much easier to edit in case your site changes themes. Give it a wirl!</p>
</div>
</div>
<div id="leftCol">
<div class="border">
<div class="padder">
<h3>Text</h3>
<label for="buttonText">Text</label>
<input id="buttonText" class="update" type="text" value="Click me!" /><br />
<label for="buttonFont">Font</label>
<select id="buttonFont" class="update" >
<option value="Andale Mono">Andale Mono</option>
<option value="Arial">Arial</option>
<option value="Arial Black">Arial Black</option>
<option value="Arial Narrow">Arial Narrow</option>
<option value="Arial Rounded MT Bold">Arial Rounded MT Bold</option>
<option value="Avant Garde">Avant Garde</option>
<option value="Baskerville">Baskerville</option>
<option value="Big Caslon">Big Caslon</option>
<option value="Bodoni MT">Bodoni MT</option>
<option value="Book Antiqua">Book Antiqua</option>
<option value="Calibri">Calibri</option>
<option value="Calisto MT">Calisto MT</option>
<option value="Cambria">Cambria</option>
<option value="Candara">Candara</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Consolas">Consolas</option>
<option value="Copperplate">Copperplate</option>
<option value="Courier New">Courier New</option>
<option value="Didot">Didot</option>
<option value="Franklin Gothic Medium">Franklin Gothic Medium</option>
<option value="Futura">Futura</option>
<option value="Garamond">Garamond</option>
<option value="Geneva">Geneva</option>
<option value="Georgia">Georgia</option>
<option value="Gill Sans">Gill Sans</option>
<option value="Goudy Old Style">Goudy Old Style</option>
<option value="Helvetica">Helvetica</option>
<option value="Hoefler Text">Hoefler Text</option>
<option value="Impact">Impact</option>
<option value="Lucida Bright">Lucida Bright</option>
<option value="Lucida Console">Lucida Console</option>
<option value="Lucida Grande">Lucida Grande</option>
<option value="Lucida Sans Typewriter">Lucida Sans Typewriter</option>
<option value="Magneto">Magneto</option>
<option value="Monaco">Monaco</option>
<option value="Optima">Optima</option>
<option value="Palatino">Palatino</option>
<option value="Papyrus">Papyrus</option>
<option value="Perpetua">Perpetua</option>
<option value="Rockwell">Rockwell</option>
<option value="Rockwell Extra Bold">Rockwell Extra Bold</option>
<option value="Segoe UI">Segoe UI</option>
<option value="Tahoma">Tahoma</option>
<option value="Times New Roman" selected>Times New Roman</option>
<option value="Tahoma">Tahoma</option>
<option value="Trebuchet MS">Trebuchet MS</option>
<option value="Verdana">Verdana</option>
</select><br />
<label for="buttonTextColor">Color</label>
<input id="buttonTextColor" class="update" /><br />
<label for="buttonTextHoverColor">Hover</label>
<input id="buttonTextHoverColor" class="update" /><br />
<label for="buttonFontWeight">Bold</label>
<input type="checkbox" id="buttonFontWeight" class="update" />,
<label for="buttonFontStyle">Italic</label>
<input type="checkbox" id="buttonFontStyle" class="update" />,
<label for="buttonTextDecoration">Underline</label>
<input type="checkbox" id="buttonTextDecoration" class="update" /><br />
<hr />
<label for="textHShadow">Shadow Horizontal</label>
<div id="textHShadow" class="slider update"></div>
<div id="textHShadow-result"></div><br />
<label for="textVShadow">Shadow Vertical</label>
<div id="textVShadow" class="slider update"></div>
<div id="textVShadow-result"></div><br />
<label for="textShadowBlur">Shadow Blur</label>
<div id="textShadowBlur" class="slider update"></div>
<div id="textShadowBlur-result"></div><br />
<label for="textShadowColor">Shadow Color</label>
<input id="textShadowColor" class="update" /><br />
</div>
</div>
<div class="border">
<div class="padder">
<h3>Border</h3>
<label for="borderStyle">Style</label>
<select id="borderStyle" class="update">
<option value="dashed">Dashed</option>
<option value="dotted">Dotted</option>
<option value="double">Double</option>
<option value="groove">Groove</option>
<option value="inset">Inset</option>
<option value="outset">Outset</option>
<option value="ridge">Ridge</option>
<option value="solid" selected>Solid</option>
</select><br />
<label for="border">Width</label>
<div id="border" class="slider update"></div>
<div id="border-result"></div><br />
<label for="borderColor">Color</label>
<input id="borderColor" class="update" /><br />
<label for="borderHoverColor">Hover</label>
<input id="borderHoverColor" class="update" /><br />
<label for="radius">Radius</label>
<div id="radius" class="slider update"></div>
<div id="radius-result"></div><br />
</div>
</div>
</div>
<div id="middleCol">
<div id="linkwrapper"><a href="#" class="button" >Click me!</a></div>
<div id="cssoutputwrapper">
<p>Use the css class below to style youre links or buttons.<br />
Ex)<a href="yoursite.com" class="button">yoursite.com</a></p>
<hr />
<div id="cssoutput"></div>
</div>
</div>
<div id="rightCol">
<div class="border">
<div class="padder">
<h3>Button</h3>
<label for="size">Size</label>
<div id="size" class="slider update"></div>
<div id="size-result"></div><br />
<label for="hpadding">Padding Horizontal</label>
<div id="hpadding" class="slider update"></div>
<div id="hpadding-result"></div><br />
<label for="vpadding">Padding Vertical</label>
<div id="vpadding" class="slider update"></div>
<div id="vpadding-result"></div><br />
<label>Width</label><div id="width"></div><br />
<label>Height</label><div id="height"></div><br />
<hr />
<label for="buttonBGColor">Color</label>
<input id="buttonBGColor" class="update" /><br />
<label for="buttonHoverBGColor">Hover</label>
<input id="buttonHoverBGColor" class="update" /><br />
<hr />
<label for="buttonHShadow">Shadow Horizontal</label>
<div id="buttonHShadow" class="slider update"></div>
<div id="buttonHShadow-result"></div><br />
<label for="buttonVShadow">Shadow Vertical</label>
<div id="buttonVShadow" class="slider update"></div>
<div id="buttonVShadow-result"></div><br />
<label for="buttonShadowBlur">Shadow Blur</label>
<div id="buttonShadowBlur" class="slider update"></div>
<div id="buttonShadowBlur-result"></div><br />
<label for="buttonShadowColor">Shadow Color</label>
<input id="buttonShadowColor" class="update" /><br />
</div>
</div>
<p>**Note: Some options may not work in other browsers</p>
<p>Ex)Text shadows do not work in IE</p><br />
<a href="http://www.brycevalero.com">brycevalero.com</a>
</div>
</body>
</html>
Javascript
$(document).ready(function() {
//Text properties----------------------------------------------------------
var size = $('#size');
size.slider({
slide:function(event,ui) {
$("#size-result").html(ui.value + "px (font)");
$(".button").css("font-size", ui.value + "px");
}
});
$('#buttonText').bind('change keydown keypress keyup', function(){
$(".button").html($(this).val());
});
$('#buttonFont').change(function(){
$(".button").css("font-family", $(this).val());
});
var weight = "normal";
$('#buttonFontWeight').change(function(){
$(".button").css("font-weight", "normal");
weight = "normal";
if(buttonFontWeight.checked){
$(".button").css("font-weight", "bold");
weight = "bold";
}
});
var style = "normal";
$('#buttonFontStyle').change(function(){
$(".button").css("font-style", "normal");
style = "normal";
if(buttonFontStyle.checked){
$(".button").css("font-style", "italic");
style = "italic";
}
});
var decoration = "none";
$('#buttonTextDecoration').change(function(){
$(".button").css("text-decoration", "none");
decoration = "none";
if(buttonTextDecoration.checked){
$(".button").css("text-decoration", "underline");
decoration = "underline";
}
});
//Text Padding------------------------------------------------------------
var hpadding = $('#hpadding');
hpadding.slider({
slide:function(event,ui) {
$("#hpadding-result").html(ui.value + "px");
$(".button").css("padding-left", ui.value + "px");
$(".button").css("padding-right", ui.value + "px");
}
});
var vpadding = $('#vpadding');
vpadding.slider({
slide:function(event,ui) {
$("#vpadding-result").html(ui.value + "px");
$(".button").css("padding-top", ui.value + "px");
$(".button").css("padding-bottom", ui.value + "px");
}
});
//Text shadow--------------------------------------------------------------
var th = 0;
var tv = 0;
var tb = 0;
var tc = "#ffffff";
var texthshadow = $('#textHShadow');
texthshadow.slider({
min:-50,
max:50,
slide:function(event,ui) {
$("#textHShadow-result").html(ui.value + "px");
th= ui.value;
$(".button").css("text-shadow",
th + "px " + tv + "px " + tb + "px " + tc);
}
});
var textvshadow = $('#textVShadow');
textvshadow.slider({
min:-50,
max:50,
slide:function(event,ui) {
$("#textVShadow-result").html(ui.value + "px");
tv= ui.value;
$(".button").css("text-shadow",
th + "px " + tv + "px " + tb + "px " + tc);
}
});
var textShadowBlur = $('#textShadowBlur');
textShadowBlur.slider({
min:0,
max:20,
slide:function(event,ui) {
$("#textShadowBlur-result").html(ui.value + "px");
tb= ui.value;
$(".button").css("text-shadow",
th + "px " + tv + "px " + tb + "px " + tc);
}
});
$("#textShadowColor").miniColors({
change: function(hex, rgb) {
tc=hex;
$(".button").css("text-shadow",
th + "px " + tv + "px " + tb + "px " + tc);
}
});
//Text Color---------------------------------------------------------------
$("#buttonTextColor").miniColors({
change: function(hex, rgb) {
$(".button").css('color', hex);
var color = $('#buttonTextHoverColor').val();
$('.button').hover( function(){
$(".button").css('color', color);
},
function(){
$(".button").css('color', hex);
});
}
});
$("#buttonTextHoverColor").miniColors({
change: function(hex, rgb) {
var color = $('#buttonTextColor').val();
$('.button').hover( function(){
$(".button").css('color', hex);
},
function(){
$(".button").css('color', color);
});
}
});
//Button Color-------------------------------------------------------------
$("#buttonBGColor").miniColors({
change: function(hex, rgb) {
$(".button").css('background-color', hex);
var color = $('#buttonHoverBGColor').val();
$('.button').hover( function(){
$(".button").css('background-color', color);
},
function(){
$(".button").css('background-color', hex);
});
}
});
$("#buttonHoverBGColor").miniColors({
change: function(hex, rgb) {
var color = $('#buttonBGColor').val();
$('.button').hover( function(){
$(".button").css('background-color', hex);
},
function(){
$(".button").css('background-color', color);
});
}
});
//Button shadow------------------------------------------------------------
var bh = 0;
var bv = 0;
var bb = 0;
var bc = "#000000";
var buttonhshadow = $('#buttonHShadow');
buttonhshadow.slider({
min:-50,
max:50,
slide:function(event,ui) {
$("#buttonHShadow-result").html(ui.value + "px");
bh= ui.value;
$(".button").css("box-shadow",
bh + "px " + bv + "px " + bb + "px " + bc);
}
});
var buttonvshadow = $('#buttonVShadow');
buttonvshadow.slider({
min:-50,
max:50,
slide:function(event,ui) {
$("#buttonVShadow-result").html(ui.value + "px");
bv= ui.value;
$(".button").css("box-shadow",
bh + "px " + bv + "px " + bb + "px " + bc);
}
});
var buttonShadowBlur = $('#buttonShadowBlur');
buttonShadowBlur.slider({
min:0,
max:20,
slide:function(event,ui) {
$("#buttonShadowBlur-result").html(ui.value + "px");
bb= ui.value;
$(".button").css("box-shadow",
bh + "px " + bv + "px " + bb + "px " + bc);
}
});
$("#buttonShadowColor").miniColors({
change: function(hex, rgb) {
bc=hex;
$(".button").css("box-shadow",
bh + "px " + bv + "px " + bb + "px " + bc);
}
});
//Border-------------------------------------------------------------------
$('#borderStyle').change( function(){
$(".button").css("border-style", $(this).val());
});
var radius = $('#radius');
radius.slider({
slide:function(event,ui) {
$("#radius-result").html(ui.value + "px");
$(".button").css("border-radius", ui.value + "px");
}
});
var border = $('#border');
border.slider({
slide:function(event,ui) {
$("#border-result").html(ui.value + "px");
$(".button").css("border-width", ui.value + "px");
}
});
//Border Color-------------------------------------------------------------
$("#borderColor").miniColors({
change: function(hex, rgb) {
$(".button").css('border-color', hex);
var color = $('#borderHoverColor').val();
$('.button').hover( function(){
$(".button").css('border-color', color);
},
function(){
$(".button").css('border-color', hex);
});
}
});
$("#borderHoverColor").miniColors({
change: function(hex, rgb) {
var color = $('#borderColor').val();
$('.button').hover( function(){
$(".button").css('border-color', hex);
},
function(){
$(".button").css('border-color', color);
});
}
});
//Events update------------------------------------------------------------
$('.update').bind('blur change click dblclick error focus focusin focusout hover keydown keypress keyup load mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup resize scroll select submit', function(){
$("#width").html($("#linkwrapper").width()+"px");
$("#height").html($("#linkwrapper").height()+"px");
$("#cssoutput").html(
".button{<br />" +
"<span id='indent'>background-color:" + $('#buttonBGColor').val() + ";</span><br />" +
"<span id='indent'>border:" + $("#border").slider("value") + "px " +
$("#borderStyle").val() + " " + $('#borderColor').val() + ";</span><br />" +
"<span id='indent'>padding:" + $('#vpadding').slider("value") + "px " +
$('#hpadding').slider("value") + "px;</span><br />" +
"<span id='indent'>border-radius:" + $('#radius').slider("value") + "px;</span><br />" +
"<span id='indent'>font-weight:" + weight + ";</span><br />" +
"<span id='indent'>font-style:" + style + ";</span><br />" +
"<span id='indent'>text-decoration:" + decoration + ";</span><br />" +
"<span id='indent'>color:" + $("#buttonTextColor").val() + ";</span><br />" +
"<span id='indent'>font-size:" + $("#size").slider("value") + "px;</span><br />" +
"<span id='indent'>font-family:\"" + $("#buttonFont").val() + "\";</span><br />" +
"<span id='indent'>box-shadow:" +
bh + "px " + bv + "px " + bb + "px " + bc + ";</span><br />" +
"<span id='indent'>text-shadow:" +
th + "px " + tv + "px " + tb + "px " + tc + ";</span><br />" +
"}<br />" +
".button:hover{<br />" +
"<span id='indent'>background-color:" + $('#buttonHoverBGColor').val() + ";</span><br />" +
"<span id='indent'>border:" + $("#border").slider("value") + "px " +
$("#borderStyle").val() + " " + $('#borderHoverColor').val() + ";</span><br />" +
"<span id='indent'>color:" + $("#buttonTextHoverColor").val() + ";</span><br />" +
"}<br />"
);
});
//Presets------------------------------------------------------------------
$("#buttonBGColor").miniColors('value', '#0000ff');
$("#buttonHoverBGColor").miniColors('value', '#0000cc');
$("#borderColor").miniColors('value', '#555555');
$("#borderHoverColor").miniColors('value', '#444444');
$("#buttonShadowColor").miniColors('value', '#000000');
$(".button").css("background-color", $('#buttonBGColor').val());
$(".button").css("padding", "10px");
$(".button").css("border-radius", "25px");
$(".button").css("border-style", $('#borderStyle').val());
$(".button").css("text-decoration", "none");
$(".button").css("color", "white");
$(".button").css("font-size", "30px");
$(".button").css("font-family", $("#buttonFont").val())
$(".button").html("Click me!");
$("#size" ).slider({value: 30});
//$("#size-result").html("30px (font)");
$("#hpadding" ).slider({value: 10});
//$("#hpadding-result").html("10px");
$("#vpadding" ).slider({value: 10});
//$("#vpadding-result").html("10px");
$("#radius" ).slider({value: 25});
//$("#radius-result").html("25px");
$("#border").slider({value: 2});
//$("#border-result").html("2px");
$(".button").css("border-width", "2px");
$('#buttonText').trigger('change');
});