Set a delay for the CSS transition effect

Use the transition-delay property to set a delay for the transition effect with CSS. You can try to run the following code to set a 1-second delay of transition:


Live Demo

<!DOCTYPE html>
         div {
            width: 150px;
            height: 150px;
            background: blue;
            transition: width 3s;
            transition-delay: 2s;
         div:hover {
            width: 350px;
      <h1>Heading One</h1>
      <p>Hover over the below box to change its width. It begins with a delay of 2 seconds.</p>