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

Michal Broniewicz
Michal Broniewicz
6,681 Points

rgba not working in background

Hey, I want to make my background image in header a little darker to make text more visible. I wanted to add black rgba layer above it with alpha so the image would still be visible.

i tried

background: linear-gradient(to bottom, transparent 50%, #F4F7F8), rgba("0, 0, 0, .5"), url("../img/calc.gif");

whenever i add rgba layer - whole background goes off. Why? And maybe there is a better way to do that

1 Answer

Boy Buijsman
Boy Buijsman
13,773 Points

Try setting the rgba value without the double quotes ", that should make it work

Boy Buijsman
Boy Buijsman
13,773 Points

The linear has only 1 color stop set. Do you want the rgba value to be the second color? Then you need to set it.