Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

box-shadow order of parameters

Tags:

css

From https://github.com/orderedlist/minimal/blob/master/stylesheets/styles.css :

box-shadow:inset #fff 0 1px 0, inset rgba(0,0,0,0.03) 0 -1px 0;

From http://www.w3schools.com/cssref/css3_pr_box-shadow.asp :

box-shadow: h-shadow v-shadow blur spread color inset;

So among other things the ordering seems to be a little different. In the github.com example inset is first whereas w3schools.com has it as being last. Does the order not matter or something? Or maybe it doesn't matter for those attributes that can be disambiguated from others?

I guess 0 is the h-shadow, 1px the v-shadow and the last 0 the blur?

like image 693
neubert Avatar asked Nov 23 '25 11:11

neubert


2 Answers

In general, only parameters of the same type have a fixed order. h-shadow, v-shadow, blur and spread therefore must appear in this order (and you can only omit from the end), but inset and colour can be placed anywhere.

like image 150
Niet the Dark Absol Avatar answered Nov 25 '25 09:11

Niet the Dark Absol


Normally,the parameters of box-shadow are in the order of horizontal-offset vertical-offset blur spread color and inset. Out of these,you can place inset and color anywhere in the list.

like image 45
Jeyanth Avatar answered Nov 25 '25 11:11

Jeyanth



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!