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
Justice Avery
8,122 Pointsi forgot what this was
The color stop value allows other background layers to show through a gradient.
3 Answers
Jose Soto
23,407 PointsI think you're referring to 'transparent':
div {
background-color:transparent;
}
Codin - Codesmite
8,600 PointsUse RGBA colours on your stop and give them an alpha less then 1.
For example a Red > Green > Blue gradient with 50% opacity would be done like this:
#grad {
background: linear-gradient(rgba(255, 0, 0, 0.5), rgba(0, 255, 0, 0.5), rgba(0, 0, 255, 0.5));
}
Codepen example: http://codepen.io/anon/pen/xbMbYB
By doing this it lets you set the individual transparency per colour on your gradient so for example you could instead do:
#grad {
background: linear-gradient(rgba(255, 0, 0, 1), rgba(0, 255, 0, 0.5), rgba(0, 0, 255, 0.25));
}
Which would give you a gradient with 100% opacity red, 50% opacity Green and 25% Opacity Blue.
Justice Avery
8,122 Pointshx XD