Skip to content

Instantly share code, notes, and snippets.

@aab595
Created February 11, 2022 10:40
Show Gist options
  • Save aab595/ce029825f3314cf0cfb6b7ce012e6aab to your computer and use it in GitHub Desktop.
Save aab595/ce029825f3314cf0cfb6b7ce012e6aab to your computer and use it in GitHub Desktop.
CSSTransitionsAnimations - 03 - Exercise
<h1>Exercise 3</h1>
Apply a 1 second transition to the width property of the div one.
Apply also a 1 second transition to the width property of the div two, but make sure the animation starts only after the div one has stopped. (hint: use delay)
<div id="main">
<div class="one"></div><br>
<div class="two"></div>
</div>
<p>Hover over the div element above.</p>
div.one {
transition: width 1s ease-in-out;
width: 100px;
height: 100px;
background: red;
}
div.two {
width: 100px;
height: 100px;
background: blue;
transition: width 1s ease-in-out 1s;
}
div#main:hover .one {
width: 300px;
}
div#main:hover .two {
width: 300px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment