ボタンタグに似せたアイコン

  1. <!DOCTYPE html>
  2. <html lang="ja">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>ボタンタグに似せたアイコン</title>
  6. <style type="text/css">
  7. .btnBase{
  8.   margin:0 2px 0 0;
  9.   padding:1px 4px;
  10.   white-space:nowrap;
  11.   text-decoration: none;
  12.   display: inline-block;
  13.   text-align: center;
  14.   font-family:"MS ゴシック", "Osaka";
  15.   font-size:12px;
  16.   color: #000;
  17.   border: 1px solid #707070;
  18.   -moz-border-radius: .3em;
  19.   border-radius: .3em;
  20. }
  21. /* ボタンの色 */
  22. .btnColr{
  23.   border: 1px solid #707070;
  24.   background: #EBEBEB;
  25.   background: -moz-linear-gradient(top, #F2F2F2, #EBEBEB 50%, #DBDBDB 50%, #CFCFCF);                                           /* Firefox       */
  26.   background: -o-linear-gradient(top, #F2F2F2, #EBEBEB 50%, #DBDBDB 50%, #CFCFCF);                                             /* Opera         */
  27.   background: -webkit-linear-gradient(linear, top, bottom, #F2F2F2, color-stop(0.5 #EBEBEB), color-stop(0.5 #DBDBDB), #CFCFCF); /* Chrome,Safari */
  28.   background: linear-gradient(linear, top, bottom, #F2F2F2, color-stop(0.5 #EBEBEB), color-stop(0.5 #DBDBDB), #CFCFCF);
  29.   filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#F2F2F2', endColorstr='#CFCFCF');            /* IE5.5、6      */
  30.   box-shadow: 0 0 2px 0 rgba(255,255,255,1) inset;
  31.   -moz-box-shadow: 0 0 2px 0 rgba(255,255,255,1) inset;
  32.   -webkit-box-shadow: 0 0 2px 0 rgba(255,255,255,1) inset;
  33. }
  34. .btnColr:hover{
  35.   border: 1px solid #3C7FB1;
  36.   background: #D9F0FC;
  37.   background: -moz-linear-gradient(top, #EAF6FD, #D9F0FC 50%, #BCE5FC 50%, #A7D9F5);                                           /* Firefox       */
  38.   background: -o-linear-gradient(top, #EAF6FD, #D9F0FC 50%, #BCE5FC 50%, #A7D9F5);                                             /* Opera         */
  39.   background: -webkit-linear-gradient(linear, top, bottom, #EAF6FD, color-stop(0.5 #D9F0FC), color-stop(0.5 #BCE5FC), #A7D9F5); /* Chrome,Safari */
  40.   background: linear-gradient(linear, top, bottom, #EAF6FD, color-stop(0.5 #D9F0FC), color-stop(0.5 #BCE5FC), #A7D9F5);
  41.   filter:  progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#EAF6FD', endColorstr='#A7D9F5');            /* IE5.5、6      */
  42. }
  43. a.btnColr:active{
  44.   box-shadow: 0 0 2px 0 rgba(128,128,128,1) inset;
  45.   -moz-box-shadow: 0 0 2px 0 rgba(128,128,128,1) inset;
  46.   -webkit-box-shadow: 0 0 2px 0 rgba(128,128,128,1) inset;
  47. }
  48. </style>
  49. </head>
  50. <body>
  51. <h1>ボタンタグに似せたアイコン</h1>
  52. <a class="btnBase btnColr" href="#">ボタン</a>←CSSでaタグをボタンっぽくしたヤツ<br />
  53. <button>ボタン</button>←buttonタグ<br />
  54. <div style="font-size:10pt;text-align:right;margin-top:0.5em;">
  55. <a href="//tips.recatnap.info/" target="_top">PCスキルの小技・忘却防止メモ</a> -
  56. <a href="//tips.recatnap.info/wiki/" target="_top">PCスキルの小技・忘却防止メモのまとめ(wiki)</a>
  57. </div>
  58. <div style="font-size:10pt;text-align:center;margin-top:0.5em;padding:0.5em;border-top:1px solid #ccc;">
  59. Copyright &copy; 2009 by PCスキルの小技・忘却防止メモ. All rights reserved.
  60. </div>
  61. </body>
  62. </html>