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

David Jarrin
PLUS
David Jarrin
Courses Plus Student 11,182 Points

CSS gradient for multiple browsers

I am trying to have a background gradient for my header but the gradient only works for safari and chrome but on IE and firefox it uses my backup code. Here is the code, any suggestions?

header {
 text-align:center;
 background-color: #E6E6E6;
 background-image:  -webkit-linear-gradient(#E6E6E6, #FFFFFF)
                    -ms-linear-gradient(#E6E6E6, #FFFFFF)
                    -moz-linear-gradient(#E6E6E6, #FFFFFF)
                    linear-gradient(#E6E6E6, #FFFFFF);
    padding:1.5em;
    font-family: 'Francois One', sans-serif;
}

1 Answer

Tom Bedford
Tom Bedford
15,645 Points

Try:

header {
 text-align: center;
 background-color: #E6E6E6;
 background: -webkit-linear-gradient(#E6E6E6, #FFFFFF);
 background: -ms-linear-gradient(#E6E6E6, #FFFFFF);
 background: -moz-linear-gradient(#E6E6E6, #FFFFFF);
 background: linear-gradient(#E6E6E6, #FFFFFF);
 padding: 1.5em;
 font-family: 'Francois One', sans-serif;
}