Files
freeCodeCamp/guide/english/css/properties/padding-property/index.md

19 lines
1019 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Padding Property
---
## Padding Property
CSS `padding` property adds internal space between the content and border of an element. You may use `padding-top`, `padding-right`, `padding-bottom` and `padding-left` for a specific side of an element, but `padding` is shorthand version for all these properties. If:
2018-10-12 15:37:13 -04:00
* If one value is provided, then it will apply to all sides of an element.
* If two values are provided, then first value will apply to the top and bottom sides and second value will apply to the left and right sides of an element.
* If three values are provided, then first value will apply to the top, second value will apply to the left and right, third value will apply to the bottom sides of an element.
* If four values are provided, then values will apply in the following order: top, right, bottom, left.
2018-10-12 15:37:13 -04:00
#### More Information:
* [MDN - padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
* [CSS-Tricks - padding](https://css-tricks.com/almanac/properties/p/padding/)