▼JavaScript使用。ボタンの背景画像として透過PNG画像を指定し、背景色の指定を変更するだけでカラフルなボタンを作成することができます。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="ja" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="imagetoolbar" content="no" />
<title>Scalable CSS Buttons Using PNG and Background Colors | 設置サンプル</title>
<link rel="stylesheet" type="text/css" href="/content/lib/global.css" />
<!-- JS -->
<script type="text/javascript" src="/content/jslib/btn.js"></script>
<!-- CSS -->
<style type="text/css">
.btn { display: block; position: relative; background: #aaa; padding: 5px; float: left; color: #fff; text-decoration: none; cursor: pointer; }
.btn * { font-style: normal; background-image: url(/content/img/css/btn2.png); background-repeat: no-repeat; display: block; position: relative; }
.btn i { background-position: top left; position: absolute; margin-bottom: -5px; top: 0; left: 0; width: 5px; height: 5px; }
.btn span { background-position: bottom left; left: -5px; padding: 0 0 5px 10px; margin-bottom: -5px; }
.btn span i { background-position: bottom right; margin-bottom: 0; position: absolute; left: 100%; width: 10px; height: 100%; top: 0; }
.btn span span { background-position: top right; position: absolute; right: -10px; margin-left: 10px; top: -5px; height: 0; }
* html .btn span,
* html .btn i { float: left; width: auto; background-image: none; cursor: pointer; }
.btn.pink { background: #e1a; }
.btn:hover { background-color: #a00; }
.btn:active { background-color: #444; }
.btn[class] { background-image: url(/content/img/css/shade.png); background-position: bottom; }
* html .btn { border: 3px double #aaa; }
* html .btn.pink { border-color: #e1a; }
* html .btn:hover { border-color: #a00; }
form, p { clear:both; float:none; margin:10px; overflow:hidden; }
.btn { margin-right:5px; }
</style>
<link rel="stylesheet" type="text/css" href="/common/css/example.css"></head>
<body id='example3' class='example'><div class="ads" style="margin:32px auto;text-align:center;"></div><h1 class='h'><a href='/'>PHP & JavaScript Room</a> :: 設置サンプル</h1>
<h3 class='h'>実行結果</h3>
<div id="wrap">
<h1><a href='http://monc.se/kitchen/59/scalable-css-buttons-using-png-and-background-colors'>Scalable CSS Buttons Using PNG and Background Colors</a> | 設置サンプル</h1>
<p>▼JavaScript使用。ボタンの背景画像として透過PNG画像を指定し、背景色の指定を変更するだけでカラフルなボタンを作成することができます。</p>
<!-- CODE -->
<p><a href="#" class="btn">灰色のボタン</a> <a href="#" class="btn pink">ピンク色のボタン</a></p>
<p><a href="#" class="btn big">灰色のボタン(大)</a> <a href="#" class="btn pink" style="font-size:200%;">ピンク色のボタン(大)</a></p>
<form action="#" onsubmit="return false;">
<fieldset>
<legend>Form Example</legend>
<p><input type="text" /></p>
<p>
<input type="button" value="リセット" class="btn" />
<input type="submit" value="送信する" class="btn pink" />
</p>
</fieldset>
</form>
<!-- / CODE -->
</body>
</html>