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

Not using "transition-property"

I didn't use transition-property for this challenge, instead I used the following code:

/* ================================= 
  Button Transitions
==================================== */

.button { 
color: #fff; 
background: #4a89ca; 
transition-duration: .4s; 
}

.button:hover {
background: #D36A62;
}

.button:active { 
background: #A33830;
border-radius: 1em;  
}

/* ================================= 
  Photo Overlay Transitions
==================================== */

.photo-overlay {
opacity: 0;  
transition-duration: 5s;
}

.photo-overlay:hover {
opacity: 1;
}

Is this ok? What are the drawback of not using the transition property in this case?

1 Answer

Steven Parker
Steven Parker
243,656 Points

:point_right: The default for transition-property is "all".

Not specifying the properties actually being transitioned just causes the CSS engine to do more work than it needs to. If you only change the properties that you want transitioned, and your system is fast enough, you will probably not notice any difference.