Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS jQuery Basics (2014) Creating a Simple Lightbox Perform: Part 4

Roman Rodionov
Roman Rodionov
6,810 Points

Inset box-shadow to lightbox

Hi! How to add inset box-shadow to lightbox image? I try, but only outset shadow added.

#overlay img {
  margin-top:10%;
  box-shadow: inset 20px 20px 50px rgba(0,0,0,0.7),
                    10px 10px 10px rgba(255,255,255,0.7);
}

1 Answer

Scott Crawford
Scott Crawford
37,861 Points

Looking at your colors the inset color is black and is shown when I use your code. The outer color is white which doesn't show at all on a white back ground. Try and play around with different colors to see if you're getting the correct effect. You can even just type in "Black", or "Orange" on colored box to see but to me it looks like the inset is working.

Roman Rodionov
Roman Rodionov
6,810 Points

Hi, Scott! I choose this colors specially, because overlay of my lightbox is black. I tried 2 times at diferent projects, but inset shadow didn't show. Can you write your CSS and JS code here? I will try again. Thank you!