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 CSS Basics (2014) Fundamental Concepts Fundamental Concepts Review

how can i make the background image visible while using the gradient color property in css

could you please remind me of the exact value to use in the background-image gradient property that will make the background image blend with the colors i specify

4 Answers

Justin Warren
Justin Warren
7,805 Points

This video looks to have an answer for you questions!


In the video, Guil used this code to create a cool background with a gradient:

background: linear-gradient(#ffa949, transparent 90%), #ffa949 url('../img/mountains.jpg') no-repeat center;

Also it is important to remember that the first value listed will be the top layer. The last one will be at the bottom.

So for this example:

background: linear-gradient(#ffa949, transparent 90%), TOP LAYER #ffa949 url('../img/mountains.jpg') no-repeat center; BOTTOM LAYER

Hope this helps!!

Thank you

dragos busuioc
dragos busuioc
24,908 Points

put in the colors from gradient an alpha transparency : rgba(0,0,0,0.6)


Justin Warren
Justin Warren
7,805 Points

Hi Brian,

Here is another great resource for continuing to learn CSS! https://www.w3schools.com/css/default.asp