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 CSS - Beyond the Basics Understanding CSS Transitions and Transforms Transitions Challenge

Lena Lekkou
Lena Lekkou
24,180 Points

what's wrong with my code?

could you see what's wrong with my code, because i cannot continue in the next step, but i can't see my mistake..

style.css
/* Complete the challenge by writing CSS below */

.button {  
  background: #4682B4;
    transition-property: background;
  transition-duration: .4s ;
}

.button:hover {
    background: #356690;
  transition-property: background;
  transition-duration: .4s ;
}
index.html
<!DOCTYPE html>
<html>
<head>
    <title>CSS Transitions</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <a class="button" href="#">Learn More</a>
</body>
</html>

Hi Lena,

What exactly was the Question? ;)

1 Answer

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

Create a .4 second transition for .button that transitions the background colors on both the hover and off states.

You only need to add properties for .button selector.

.button {  
  background: #4682B4;
  transition-property: background;
  transition-duration: .4s;
}

.button:hover {
    background: #356690;
}
Lena Lekkou
Lena Lekkou
24,180 Points

thank you william! this was the problem! have a nice day!

William Li
William Li
Courses Plus Student 26,868 Points

you're welcome, Lena, you have a nice day too :)