<!DOCTYPE html> <html > <head> <style type="text/css"> .frame { height: 200px; width: 200px; overflow: hidden; } .zoomin img { height: 200px; width: 200px; -webkit-transition: all 2s ease; -moz-transition: all 2s ease; -ms-transition: all 2s ease; transition: all 2s ease; } .zoomin img:hover { width: 300px; height: 300px; } </style> </head> <body> <div class="zoomin frame"> <img src="img/zimage.png" title="Scale on Hover with Transition using CSS" /> </div> </body> </html> Code (markup): - See more at: http://www.corelangs.com/css/box/zoom.html#sthash.pXDIoCho.dpuf Code (markup): Hi i need help with this ... seems like when it zoom is not proportional! why? can somebody help me.!
Because you've set the image both width and height. If you want it to be proportional, you need to let go; either its width or height. Example: .zoomin img{ width: 100%; /*relatively to parent .frame*/ height: auto; /*allow it to adjust by itself*/ transition: all 2s ease; } Code (CSS):