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

19 lines
939 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Padding Property
---
## Padding Property
CSS `padding` property adds internal space between the content and border of element. You may use `padding-top`, `padding-right`, `padding-bottom` and `padding-left` for specific side of element, but `padding` is shorthand version for all these properties. If:
* One value is provided it will apply to all sides of element
* Two values are provided, first value will apply top and bottom sides and second value will apply to left and right sides of element.
* Three values are provided, first value will apply to top, second value will apply left and right, third value will apply bottom sides of element.
* Four values are provided, values will apply in the following order: top, right, bottom, left.
#### 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/)