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 trialJohn Burtness
466 PointsNext, 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
Courses Plus Student 2,896 PointsHi. 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
4,260 PointsDid you try exactly what you have in quotes from the error? back-ground image?
Also, could you share the challenge?
John Burtness
466 PointsIt'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
4,260 PointsComplete 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!
John Burtness
466 PointsI've tried that and it doesn't work, it gives the same error. I think it's a bug.
Todd Anderson
4,260 PointsHmm... did you try copy and pasting my code? Maybe it is a bug.
Jay Padzensky
4,731 PointsI copied and pasted
background-image: linear-gradient();
into the CSS declaration and passed task 2.
John Burtness
466 PointsI did copy and paste it exactly how you wrote it.
Todd Anderson
4,260 PointsYeah, I'm not sure then. Sorry.
Aaron Moorman
16,150 PointsIm having the same problem. I don't know what's going on.