开发者

Box-shadow not working on Webkit?

开发者 https://www.devze.com 2022-12-25 01:08 出处:网络
I\'m creating multiple borders to element using box-shadow, but they don\'t show at Webkit. What\'s wrong with this code? I\'m using this four times to create shadow on each side, then border for extr

I'm creating multiple borders to element using box-shadow, but they don't show at Webkit. What's wrong with this code? I'm using this four times to create shadow on each side, then border for extra border

box-shadow: 1px 1px 0px rgba(0,开发者_JS百科0,0,0.1);

Martti Laine


to display box-shadow in webkit browsers you have to use the following statement at the moment:

-webkit-box-shadow: 1px 1px 0px rgba(0,0,0,0.1);

To make it compatible with most modern browsers use this:

-webkit-box-shadow: 1px 1px 0px rgba(0,0,0,0.1);
-moz-box-shadow: 1px 1px 0px rgba(0,0,0,0.1);
box-shadow: 1px 1px 0px rgba(0,0,0,0.1);


This works well enough, but please note that best practice is to place the non-proprietary declaration last.

-webkit-box-shadow: 1px 1px 0px rgba(0,0,0,0.1);
-moz-box-shadow: 1px 1px 0px rgba(0,0,0,0.1);
box-shadow: 1px 1px 0px rgba(0,0,0,0.1);
0

精彩评论

暂无评论...
验证码 换一张
取 消