Default box shadow color? [duplicate]
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 ...)
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 thecolor
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.
While there isn't a box-shadow-color
property yet, box-shadow
defaults to color
, just like border
does.
In practice, you have to change the color
property and leave box-shadow
without a color:
box-shadow: 1px 2px 3px;
color: #a00;'
Check out the demo
Support:
- Safari 6+
- Chrome 20+ (at least)
- Firefox 13+ (at least)
- (IE not tested)
精彩评论