Search code examples
csswebkitmozillabox-shadow

Default box shadow color?


What color do the *box-shadows default to if none is specified?

-webkit-box-shadow: 4px 4px 5px;
-moz-box-shadow: 4px 4px 5px;
box-shadow: 4px 4px 5px;

How can I set that color separately? (According to Is there a 'box-shadow-color' property? there isn't a thing such as *box-shadow-color ...)


Solution

  • See: https://developer.mozilla.org/en/css/box-shadow

    <color> (optional)
    See <color> values for possible keywords and notations. If not specified, the color depends on the browser. In Gecko (Firefox), the value of the color property is used. WebKit's shadow is transparent and therefore useless if <color> is omitted.

    You can only set the color inside box-shadow, for example:

    box-shadow: 4px 4px 5px #ccc;
    

    You simply can't set it separately, because as you pointed out, no box-shadow-color property exists.