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!

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

Kailash Seshadri
Kailash Seshadri
3,085 Points

[SOLVED] My whole background image disappears when adding the gradient

I feolowed along correctly and all of my code seems to be correct vut when i refresh the preview, the whole background dissapears and is replaced by the default, white background..

The workspace preview: http://w.trhou.se/pmalvj8kmm

Thanks for all your help!!

Kailash Seshadri
Kailash Seshadri
3,085 Points

Its ok.. I found the problem: in the background property i had a space after the linear-gradient property:

.main-header {
  padding-top: 170px;
  height: 850px;
               /* space here \/   */
  background: linear-gradient  (#ffa646, transparent 90%),
              #ffa949 url('../img/mountains.jpg') no-repeat center;
  background-size: cover;
}

and changed it to:

.main-header {
  padding-top: 170px;
  height: 850px;
               /* no space  \/  */
  background: linear-gradient(#ffa646, transparent 90%),
              #ffa949 url('../img/mountains.jpg') no-repeat center;
  background-size: cover;
}

And it worked.. Thanks! :-)