Tryit Editor v1.8

Source Code:
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:red; transition-property:width,height; transition-duration:2s; /* Safari */ -webkit-transition-property:width,height; -webkit-transition-duration:2s; } div:hover { width:300px; height:300px; } </style> </head> <body> <p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p> <div></div> <p>Hover over the div element above, to see the transition effect.</p> </body> </html>
Result:
W3Schools.com - Try it yourself