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 CSS Basics (2014) Enhancing the Design With CSS Transparent Gradients and Multiple Backgrounds

Multiple backgrounds

I learned that : if we defined a fully opaque background-image or color, anywhere above the bottom layer, it will cover up the background images behind it.

Now, is someone able to give me a concrete example because I don't really understand.

1 Answer

I'm not sure I understood the question completely, but I hope this helps:

Let's say your body element has a background-image, and you have a div that has a background-color attribute. When you load the page, you will see that the image is covered by your div!

<html>
    <body style="background-color: black">
        <div style="width:50px; height:50px; background-color: white">
        </div>
    </body>
</html>

You can try to view this code, hope it helps!