My animated div gets knocked up, not backwards during animation

I created a basic div with a heading and a paragraph inside it, and when I do a multi-stage animation, the box pops up instead of going back. This makes him look very silly and strange. You can view my bug at . Code:

<div class="enlarge">
    <h1 class="title">Welcome!</h1>
$(document).ready(function() {
$(".enlarge").animate({minHeight: '500px'}, "slow");
$(".enlarge").animate({width: '80%'}, "slow");
.enlarge {
height: 500px;
width: 50%;
background-color: #2098D1;
align-items: center;
align-content: center;
border-radius: 15px;
position: relative;
margin: 10px auto;




source to share

1 answer

It seems that the problem is with the default add-on. Try to set padding on div (even 1px appears to fix the crash).

    padding: 1px;




All Articles