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 trial

CSS CSS Transitions and Transforms Getting Started with CSS Transforms Animating a CSS Transform

No need to specify transition for logo?

Hi,

I was asking myself if there is no need to specify a transition for the animation of logo as for the img! Do we have always to specify a transition or not? How does the browser set the transition duration for the logo if we do not specify it??? Thx

2 Answers

Miroslav Kovac
Miroslav Kovac
11,454 Points

Hi Luca,

I think that you want to ask why there was no css transition for ".logo" image. Answer is that the logo is also an img so the same transition is used for logo and for other images.

img {
    transition: transform .5s;
}

No, you definitely don't need to put transitions or animations on anything. They just provide a bit of visual flair.

In fact, best practice is generally only to add animations where they help communicate a particular idea, message or action.

As for transition-duration (one of the properties included in the transition shorthand), the initial/default value is 0s, or zero seconds. So any transition you add would happen instantly, as if it weren't animated at all.