Posted By

JimSangwine on 05/05/11


Tagged


Versions (?)

Perfect CSS Sprite / Sliding Doors Button


 / Published in: CSS
 

  1. /* HTML */
  2.  
  3. <a class=”GlobalOrangeButton” href=”http://yourwebsite.com”><span>So Neat!</span></a>
  4.  
  5. /* CSS */
  6.  
  7. a.GlobalOrangeButton span {
  8. background: transparent url(’http://media-sprout.com/tutorials/web/CSSSprit-SlideButton/images/button_left_orange.png’) no-repeat 0 0;
  9. display: block;
  10. line-height: 22px;
  11. padding: 7px 0 5px 18px;
  12. color: #fff;
  13. }
  14.  
  15. a.GlobalOrangeButton {
  16. background: transparent url(’http://media-sprout.com/tutorials/web/CSSSprit-SlideButton/images/button_right_orange.png’) no-repeat top right;
  17. display: block;
  18. float: left;
  19. height: 34px;
  20. margin-right: 6px;
  21. padding-right: 20px;
  22. text-decoration: none;
  23. font-family: Arial, Helvetica, sans-serif;
  24. font-size:12px;
  25. font-weight:bold;
  26. }
  27.  
  28. a.GlobalOrangeButton:hover span {
  29. background-position: 0 -34px; color: #fff;
  30. }
  31.  
  32. a.GlobalOrangeButton:hover {
  33. background-position: right -34px;
  34. }

Report this snippet  

You need to login to post a comment.