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

Gina Bégin
PLUS
Gina Bégin
Courses Plus Student 8,613 Points

-Webkit- Challenge Code...?

"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."

CSS provided:

/* Complete the challenge by writing CSS below */  

.box {  
 border-radius: 15px;   
 background: #4682B4;  
}  

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

I tried a few different things, like adding the -webkit-transition: 2s 1s; right after the .box background property but wasn't sure how to code the linear motion or if that was even the right place to put the transition since you also need to specify a transition of the border-radius itself. There are so many different variables in this one challenge question that I'm just not sure where I'm messing up.

4 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Gina;

CSS transitions accept the following values in shorthand notation:

transition: <transition-property> <transition-duration> <transition-timing-function> <transition-delay>;

For this challenge then, as we are asked to apply it to webkit browsers, we need to use the -webkit-transition: property and assign it the appropriate values as given from the challenge.

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

You can certainly use the longhand notation and list out each property on separate lines, but in larger style sheet reducing the code by as much as possible is a best practice.

Happy coding,

Ken

Gina Bégin
Gina Bégin
Courses Plus Student 8,613 Points

I tried that but it's still not working. I then tried adding a border-radius transition to .box:hover {} but I'm just not getting it and can't find much documentation about this stuff online since it's supposedly not universally supported yet.

Robert Manolis
STAFF
Robert Manolis
Treehouse Guest Teacher

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

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

try this

Chris Martinez
Chris Martinez
11,715 Points

make sure you are adding it to the .box rule and NOT the .box:hover rule