Box-shadow
Hi - i am a beginner in HTML / CSS / Javascript. I have made a container div inside the body. The body has a back ground color. And the div container too has a back ground color. I wanted to give the div container a box-shadow but it does not show. Please help? I tried using position:relative and z-index:10 inside the container too.
9 Replies
share your code, there's some helpful tips in #how-to-ask-good-questions for how you can do that
preferably in something like codepen so people can see it live in their own browsers
https://codepen.io/seemaenand/pen/wvReNgK
Thats my work in progress
your boxshadow isn't properly formatted. You've just got some values in brackets, you need to add
rgba
:
if you inspect the element in the devtools, and look at the property, you'll see that the boxshadow is invalid:
ok - thanks
Thank you so much - it worked 🙂
glad to help 🙂
also, the last value in the rgba is a value between 0 and 1
5 will be interpreted as 1 opacity
if you want 5% you need to set it to 0.05
nice catch, I didn't spot that one
i almost didnt either