Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSAMUEL LAWRENCE
Courses Plus Student 8,447 PointsHow do you transition **all** animatable properties using the transition shorthand?
Hi Guil Hernandez mentioned the keyword all if you wanted to transition all animatable properties when using the transition properties individually. When he introduced the transition shorthand, he forgot to mention that. How would you transition all the properties using the shorthand. the order is transition-property then transition-duration then transition-timing-function then transition -delay.
.box {
transition: margin 1s cubic-bezier(.5, -.5, .3, 1.3), ease 0s, background .6s ease 1s;
}
So how would this look if you wanted to transition both the margin and background the same?
Thanks
1 Answer
erdragerdragsson
Courses Plus Student 5,887 PointsLike this i think
.box {
transition:all margin 1s cubic-bezier(.5, -.5, .3, 1.3), ease 0s, background .6s ease 1s;
}
SAMUEL LAWRENCE
Courses Plus Student 8,447 PointsSAMUEL LAWRENCE
Courses Plus Student 8,447 PointsThanks buddy. So simply, why didn't i think of this? No wait, that's not right. because you used all plus margin plus background. but taking from what you wrote I think it's actually like this. I tried it out and think it worked properly.
you can actually omit the all
erdragerdragsson
Courses Plus Student 5,887 Pointserdragerdragsson
Courses Plus Student 5,887 Pointsah okey, glad it you got it to work!
// Erdrag