Use the CSS transition property to set all the four transition properties into a single line. You can try to run the following code to work with the transition property −
Example
<!DOCTYPE html> <html> <head> <style> div { width: 150px; height: 150px; background: blue; transition: height 3s; } div:hover { height: 250px; } </style> </head> <body> <h1>Heading One</h1> <p>Hover over the below box to change its height.</p> <div></div> </body> </html>