I'd just like to say this is pretty messy. This is untested, but uses the smallest possible amount of elements. It's a four-way sliding door.
HTML:
<a href="your-url-here" class="button">
<div class="inner-1">
<div class="inner-2">
<div class="inner-3">
Your stuff
</div>
</div>
</div>
</a>
CSS:
a.button {
background: url('topleft-image-url') no-repeat top left;
display: block;
float: left;
}
a.button .inner-1 { url('topright-image-url') no-repeat top right; }
a.button .inner-2 { url('bottomright-image-url') no-repeat bottom right; }
a.button .inner-3 {
url('bottomleft-image-url') no-repeat bottom left;
padding: 0.5em;
}
// You still need to re-speicify the extra attributes of background for browser compatibility
a.button:hover { background: url('topleft-image-url-over') no-repeat top left; }
a.button:hover .inner-1 { url('topright-image-url-over') no-repeat top right; }
a.button:hover .inner-2 { url('bottomright-image-url-over') no-repeat bottom right; }
a.button:hover .inner-3 { url('bottomleft-image-url-over') no-repeat bottom left; }
If you get rid of one of the size constraints (eg. width or height), you can drop two div
s (ie. make a two-way sliding door).
With either technique you can optimise your image by creating a gif or png with enough transparency between the segments to exceed the maximum bounds of width and height your button will experience. One for each state, this would allow you to only require two images instead of eight.
With a bit of thought you could probably figure out how to merge both states into a single image too, using percentage- or pixel- based background positioning. This would allow you to simplify the CSS, too.