画像リンクにマウスオーバーで半透明

  1. <!DOCTYPE html>
  2. <html lang="ja">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>画像リンクにマウスオーバーで半透明</title>
  6. </head>
  7. <body>
  8. <h1>画像リンクにマウスオーバーで半透明</h1>
  9. <style type="text/css">
  10. a.opa75 img:hover
  11. {
  12.   filter:alpha(opacity=75);
  13.   -moz-opacity:0.75;
  14.   opacity:0.75;
  15. }
  16. a.opa50 img:hover
  17. {
  18.   filter:alpha(opacity=50);
  19.   -moz-opacity:0.50;
  20.   opacity:0.50;
  21. }
  22. a.opa25 img:hover
  23. {
  24.   filter:alpha(opacity=25);
  25.   -moz-opacity:0.25;
  26.   opacity:0.25;
  27. }
  28. </style>
  29. <div>
  30. <h2>不透明度75%</h2>
  31. <a class="opa75" href="#"><img src="images/catnapsample.gif" /></a>
  32. <h2>不透明度50%</h2>
  33. <a class="opa50" href="#"><img src="images/catnapsample.gif" /></a>
  34. <h2>不透明度25%</h2>
  35. <a class="opa25" href="#"><img src="images/catnapsample.gif" /></a>
  36. </div>
  37. <div style="font-size:10pt;text-align:right;margin-top:0.5em;">
  38. <a href="//tips.recatnap.info/" target="_top">PCスキルの小技・忘却防止メモ</a> -
  39. <a href="//tips.recatnap.info/wiki/" target="_top">PCスキルの小技・忘却防止メモのまとめ(wiki)</a>
  40. </div>
  41. <div style="font-size:10pt;text-align:center;margin-top:0.5em;padding:0.5em;border-top:1px solid #ccc;">
  42. Copyright &copy; 2009 by PCスキルの小技・忘却防止メモ. All rights reserved.
  43. </div>
  44. </body>
  45. </html>