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

Gradients and images.

Hi all! I have a problem in Sublime text2,when I want to use gradients and images on the same background.I tryed to use hexdecimal colors, keywords, rgb, and hsl values.Nothing seems to work. MY CODE:

background: url(../../Vjezba/zoki.jpg) 0 0 no-repeat, linear-gradient(#72c417, #5c9e19);

I'v tried everything. Is the problem in Sublime text2 or am I doing something wrong.

PLZ HELP.

3 Answers

LaVaughn Haynes
LaVaughn Haynes
12,397 Points

Looks fine. I would say make sure that your path to your image is correct.

Example: http://codepen.io/drbrounsuga/pen/gPWZRE

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Background properties</title>
  <style>
    body{
      background: url(http://www.fillmurray.com/200/300) 0 0 no-repeat, linear-gradient(#72c417, #5c9e19);
    }
  </style>
</head>
<body>

</body>
</html>

My image works fine,but when i want to add a gradient over image it doesnt work.So I am just wondering is sublime text2 not working. Thanks for answering!

LaVaughn Haynes
LaVaughn Haynes
12,397 Points

I'm using Sublime 3. I don't recall there being a way for Sublime 2 to display HTML though. Are you using a plugin? If so, what? How are you viewing the rendered HTML?

Also, If you add my code above to a new html file does it work for you?

Thanks

It doesnt work in sublime text2.I will try to use it in Sublime text3 and get back.