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

Mona Jalal
Mona Jalal
4,302 Points

linear gradient not working

.jumbotron{
    color: #660198;
    background: linear-gradient(bottom left, rgba(25,21,52 , .975), rgba(25,21,52 , .925), rgba(128, 0, 128, .25)) ;
}

the text color changes but background no, why?

3 Answers

Benjamin Larson
Benjamin Larson
34,055 Points

I believe the standard syntax rules for CSS3 gradients require your direction parameter (in this case, "bottom left"), to be prefixed with "to". Depending on the browser you are viewing this in, there may be a slight variation on the syntax rules that you'll have to lookup.

.jumbotron { 
  color: #660198; 
  background: linear-gradient(to bottom left, rgba(25,21,52 , .975), rgba(25,21,52 , .925), rgba(128, 0, 128, .25)) ; 
}
Tom Checkley
Tom Checkley
25,165 Points

https://css-tricks.com/css3-gradients/

background: linear-gradient(to bottom left, rgba(25,21,52 , .975), rgba(25,21,52 , .925), rgba(128, 0, 128, .25));

to bottom left is the new spec, sorry about previous answer, hadn't used gradients for a while

Tom Checkley
Tom Checkley
25,165 Points

i think it needs to be background-color