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

Jake Ford
9,230 PointsCSS Linear gradient not working
I want to have a linear gradient at the top and bottom of my background image, to transition smoothly into the white background. For some weird reason, my top gradient is working, but not the bottom! Here is a link to it, scroll down to the bottom and you will see what I am talking about: http://jakeford.io/pwi-test/home.html
My CSS:
.features{
height: 100%;
background: linear-gradient(top, #fff, transparent);
background: linear-gradient(to bottom, transparent, #fff);
background-image: url('assets/Background_Features.jpg');
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

Daniel Gonzalez
22,105 PointsDo you want the gradient to extend to the next picture at the bottom? it seems to work but then there is another picture that has no gradient.
1 Answer

Timothy Blubaugh
9,522 PointsIf you want to overlay an image with color this is the CSS you need to use. Let me know if you have any questions.
.features{
height: 100%;
<!-- You can change the RGB to make it whatever color you want and the alpha to change the transparency. -->
background-image: linear-gradient(to top, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.5));
url('assets/Background_Features.jpg');
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

Jake Ford
9,230 PointsThank you guys!!
Daniel Gonzalez
22,105 PointsDaniel Gonzalez
22,105 PointsHi Jake,
Can you resend the link to view your code. Your linear gradient is going from transparent to white, do you have a contrasting background color behind the gradient?