I want to change width of background image of div on hover. My code is :
HTML :
<div class="block2 todrop" target="regbuyer.php"></div>
CSS:
.col1 .block2 { float: right; margin: 104px 0 0 0; width: 208px; height: 104px; background: url(../images/block2-1.jpg) no-repeat center center; background-size: 100% 100%; }
.todrop { cursor: pointer; }
I just re-read the question and realized I’m a doofus
You can’t actively change the background size, however, you can use classes that have different background sizes, and alternate between the two on hover.
The CSS.
Just start with one of those on the element when it’s created and you’re good to go.
Fiddle