I am playing around with the Less Framework 3 and I saw this line in the css:
body { padding: 60px 42px 0; width: 396px; }
what does padding: 0
do?
This does not look like normal css shorthand, and top-right-bottom
seems weird.
When three values are specified, the first padding applies to the top, the second to the right and left, the third to the bottom. When four values are specified, the paddings apply to the top, right, bottom, and left in that order (clockwise).
The padding property in CSS defines the innermost portion of the box model, creating space around an element's content, inside of any defined margins and/or borders. Padding values are set using lengths or percentages, and cannot accept negative values. The initial, or default, value for all padding properties is 0 .
Padding is a term used to describe the process of filling a field with pad characters. For example, if a name field required ten characters and your name was "Bob" (3 characters) the field would be "Bob0000000" where the 0's are the padding characters. 2.
The padding
and margin
properties specify top right bottom left
.
If left
is omitted, it will default to right
.
Thus, padding: a b c
is equivalent to padding: a b c b
.
If bottom
is also omitted, it will default to top
.
Thus, padding: a b
is equivalent to padding: a b a b
.
If right
is also omitted, the single value is used for all 4 sides.
Thus, padding: a
is equivalent to padding: a a a a
.
When you specify three values the second is implicitly used for the fourth, i.e. padding: 60px 42px 0 42px;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With