Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Revisions

3 of 6
deleted 10 characters in body
Ahsan Khurshid
  • 9.5k
  • 1
  • 35
  • 53

Edited (As sugessted by Zach L):

I think you are trying to do as did in this DEMO

HTML

<input type="submit" value="" class="imgClass" />

THREE STATES OF BUTTON, NORMAL, HOVER, ACTIVE

CSS:

.imgClass { 
 background-image: url(http://inspectelement.com/wp-content/themes/inspectelementv2/style/images/button.png);
 background-position: 0px 0px;
 background-repeat: no-repeat;
 width: 186px;
 height: 53px;
 border: 0px;
}
.imgClass:hover{ 
 background-position: 0px -52px;
}
.imgClass:active{
 background-position: 0px -104px;
}

You need to use CSS Image Sprites for button states.

See The Mystery of CSS Sprites

Ahsan Khurshid
  • 9.5k
  • 1
  • 35
  • 53

AltStyle によって変換されたページ (->オリジナル) /