<style>
.rotated {
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
}
#test {
width: 60px;
height: 60px;
border: 1px gray solid;
background: url(http://www.uksafari.com/pics/tree.gif) no-repeat 15 15;
}
</style>
<div id="test" onclick="this.className='rotated'"></div>