Question about box-shadow

I’m doing the lesson “Add a box-shadow to a card-like element.”
I noticed when I wrote #thumbnail{ box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0, 0, 0, 0.23); my solution was correct.
But what i was writing before was box-shadow: **0px** 10px 20px rgba(0, 0, 0, 0.19), **0px** 6px 6px rgba(0, 0, 0, 0.23); which was not an accepted solution

If the syntax is `offsetX offsetY blur-radius spread-radius color(0, 0, 0, 0.x); why doesnt the offsetX get a px after it like offsetY and the blur-radius in my attempted solution?

Hi, I know this one is old, but maybe you are still wondering about this or other people like me come across wondering what this is about. I’m still an absolute newbie myself and just started with the courses, so maybe someone with a little more experience can check my explanation. However, here is my idea:

As I see it, the box-shadow property accepts 0 as well as 0px because if a value is 0 the unit doesn’t matter – like 0mm is also 0km, there is no difference. If the value would be 1 the software probably has got no idea what to do with it. I think that’s why math and physics teachers always ask for apples if your answer doesn’t include any unit.
The reason the test is failing for 0px is probably far more simple. I guess the system is just checking if you actually used „the example CSS values above“, as told in the task. It probably is checking if the strings are matching – like really character for character. So if you do any minor changes, no matter if it’s affecting the outcome, the test fails because you didn’t use „the example CSS values above“.
I guess some people just omit the unit on 0 values, because it works and is a bit less typing, which probably can matter if you type hundreds of lines of code a day.

Hope that’s about right and also helpful to someone.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.