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

Next, add a background-image property and define a linear gradient function as the value.

Im in CSS basics, challenge task 2 of 4 and the question is:

Next, add a background-image property and define a linear gradient function as the value.

My answer: .main-header { width:100%; background-image: linear-gradient(to top, blue, orange); }

Its giving me, "Bummer! Make sure you're creating the gradient with a 'back-ground image' property.

I've tried to add percentages after the colors, changed it to background instead of background-image, changed the colors to hexidecimal colors. Does anyone know the answer to this? Is this a bug?

7 Answers

Peter B. Sims
PLUS
Peter B. Sims
Courses Plus Student 2,896 Points

Hi. I wrote this and passed. Not sure but it worked for me. I chose 'font-size' as my first rule. Good luck!

.main-header { font-size: 100px; background-image: linear-gradient(left, red, blue); }

.main-header { background-image: linear-gradient(left, red, blue); }

Todd Anderson
Todd Anderson
4,260 Points

Did you try exactly what you have in quotes from the error? back-ground image?

Also, could you share the challenge?

It's Enhancing the Design with CSS- Gradients challenge. I'm using the background-image property to define a linear gradient function, which should be: background-image: linear-gradient(); But it's not working.

Todd Anderson
Todd Anderson
4,260 Points

Complete answer:

.main-header{
  background-image: linear-gradient(to top, steelblue, darkslateblue 90%);}

For that step I believe they just want

background-image: linear-gradient();

Then they give you specific colors and a stop percentage.

I hope this helps!

I've tried that and it doesn't work, it gives the same error. I think it's a bug.

Todd Anderson
Todd Anderson
4,260 Points

Hmm... did you try copy and pasting my code? Maybe it is a bug.

Jay Padzensky
Jay Padzensky
4,731 Points

I copied and pasted

background-image: linear-gradient();

into the CSS declaration and passed task 2.

I did copy and paste it exactly how you wrote it.

Todd Anderson
Todd Anderson
4,260 Points

Yeah, I'm not sure then. Sorry.

Im having the same problem. I don't know what's going on.