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

Johnny Whitfield
Johnny Whitfield
14,024 Points

Why won't this accept my code? I've tried everyway I knew to type it.

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

index.html
<!DOCTYPE html>
<html>
<head>
    <title>CSS Transitions</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="box"></div>
</body>
</html>
style.css
/* Complete the challenge by writing CSS below */

.box {
    border-radius: 15px;
    background: #4682B4;
  transition: 2s, cubic-bezier (0, 0, 1, 1), 1s;
 }

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

2 Answers

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

There's a few areas where you are going wrong. Firstly, you have not used the -webkit prefix as stated in the first portion of the challenge.

Second, when using transition, the order is:

transition: [transition-property] [transition-duration] [transition-timing-function] [transition-delay];

The challenge is asking to transition the border-radius property of .box, so the first portion for transition-property should be set to border-radius. The second is the duration, which the challenge is asking be set to 2s. Jumping ahead it specifies that the transition should "maintain a linear motion" so the transition-timing-function we use is "linear", and finally for the transition delay it asks for 1s. Together you have:

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

.box:hover {
    background: #F08080;
    border-radius: 50%;
}
Johnny Whitfield
Johnny Whitfield
14,024 Points

I did use the -webkit-transition for a while, but always forgot the border-radius part in each variation I tried. Thank you Mike!

You're welcome, glad you got it sorted.