CSS Transition property

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 −


Live Demo

<!DOCTYPE html>
         div {
            width: 150px;
            height: 150px;
            background: blue;
            transition: height 3s;
         div:hover {
            height: 250px;
      <h1>Heading One</h1>
      <p>Hover over the below box to change its height.</p>