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 Unused CSS Stages Transitions and Transforms Transitions - WebKit Only

Samuel Glister
Samuel Glister
12,471 Points

Transition Code Challenge

Hi All,

I'm currently doing the CSS deep dive transition code challenge and can't get it to accept my CSS.

The mark up i'm using is

.box {
    border-radius: 15px;
    background: #4682B4;
    -webkit-transition: border-radius;
        -webkit-animation-duration: 2s; 
    -webkit-transition-delay: 1s; 
    -webkit-animation-timing-function: linear;
 }

.box:hover {
    background: #F08080;
    border-radius: 50%;

}

1 Answer

Hi Samuel,

You used the word animation a couple of times instead of transition

Also, I would recommend that you use the individual properties throughout or use the shorthand property only.

You used the shorthand property -webkit-transition: border-radius; rather than the individual property -webkit-transition-property: border-radius;

While this will work:

-webkit-transition: border-radius;
-webkit-transition-duration: 2s; 
-webkit-transition-delay: 1s; 
-webkit-transition-timing-function: linear;

This will not work: (notice the order change)

-webkit-transition-duration: 2s; 
-webkit-transition: border-radius;
-webkit-transition-delay: 1s; 
-webkit-transition-timing-function: linear;

When using the shorthand property, all the omitted values will be set back to their initial state. This means that you will lose the duration that you've already set.

I recommend instead that you either do this: (consistent use of individual properties)

-webkit-transition-property: border-radius;
-webkit-transition-duration: 2s; 
-webkit-transition-delay: 1s; 
-webkit-transition-timing-function: linear;

Or a single shorthand property:

-webkit-transition: border-radius 2s linear 1s;