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

Christopher van Ruitenbeek
Christopher van Ruitenbeek
13,705 Points

Validator bugged?

I am trying to pass my code... But the system just doesn't want me to pass.

Error message: Bummer! Make sure you're writing the transition properties in the correct rule.

I've tried this so far:

/* Saying: transition-duration for all elements: .4s. */
.button {
background: #468268;
transition-duration: .4s;
}
.button:hover {
background: #356690;
transition-duration: .4s;
}
/* Defining transition property (as first done in the video). */
.button {
background: #468268;
transition-duration: .4s;
}
.button:hover {
background: #356690;
transition-property: background;
transition-duration: .4s;
}
/* For good measure, also defining the transitioning object property. */
.button {
background: #468268;
transition-property: background;
transition-duration: .4s;
}
.button:hover {
background: #356690;
transition-property: background;
transition-duration: .4s;
}
/* Using the shorthand version saying: All transition elements take .4s. */
.button {
background: #468268;
transition: .4s;
}
.button:hover {
background: #356690;
transition: .4s;
}
/* Using the "all" property to highlight that all elements need to transition (just like in the video). */
.button {
background: #468268;
transition-duration: .4s;
}
.button:hover {
background: #356690;
transition-property: all;
transition-duration: .4s;
}

Edit ---------------------------------------------------- after Nick's answer I tried:

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

.button:hover {
  background: #356690;
  transition-property: background;
}

and

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

.button:hover { background: #356690; transition-property: background; }

None shall pass...

2 Answers

When i'm posting the following below at challenge task it's working: Create a .4 second transition for .button that transitions the background colors on both the hover and off states.

/* Complete the challenge by writing CSS below */

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

.button:hover {
    background: #356690;
}

Remove the transition-duration out of the :hover Than it works