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

why is this code not working, everything is working perfectly in the preview.

.box {
    border-radius: 15px;
    background: #4682B4;
   -webkit-transition-duration: 5s;
 }

.box:hover {
    background: #F08080;
    border-radius: 50%;
  -webkit-transition:border-radius, 2s, linear, 1s; 
}

5 Answers

Sreng Hong
Sreng Hong
15,083 Points

First, you only apply the -webkit-transition to the class .box

Second, you don't need a comma to separate the values of the -webkit-transition

jeremy silver
jeremy silver
1,996 Points
.box { 
    background: #4682B4; 
    -webkit-border-radius: 15px; 
    border-radius: 15px; 
    -webkit-transition-duration: 5s; 
    transition-duration: 5s; 
}

.box:hover {
    background: #F08080; 
    -webkit-border-radius: 50%; 
    border-radius: 50%; 
    -webkit-transition: border-radius 2s linear 1s;  /* This line was not written correctly */
    transition: border-radius 2s linear 1s; 
}

If you're adding browser prefixes you should keep things consistent and add them to all css3 attributes, but Sreng is right that the hover transition was written incorrectly.

Thank You Jeremy and Sreng, I made the changes that you both suggested however, it's still not working for me. I think I am going to contact support. Thanks again for your help.

  • Jon
jeremy silver
jeremy silver
1,996 Points

What are the specific coding instructions that this isn't working for.

Jeremy,

Here are the coding instructions:

Using the prefix for WebKit-based browsers, create a transition for the border-radius property of .box. Give the transition a duration of 2 seconds, a delay of 1 second, and a timing function that maintains a linear motion.

jeremy silver
jeremy silver
1,996 Points

I haven't taken any CSS tracks here, so I'm not sure what they expect of the user.

-webkit-transition: border-radius 2s linear 1s; <-- is correct, but maybe they want it written out like this...?

.box {
  -webkit-transition: border-radius;
  -webkit-transition-duration: 2s;
  -webkit-transition-timing-function: linear;
  -webkit-transition-delay: 1s;
}