Padding creates spacing between the perimeter of an html element and the content contained within it.
In this tutorial we will add padding around the text contained within our
Similar to margins, padding can be added around all four sides of an element, or only specified sides.
First we will add padding around all sides. To do that, type the following style definition in your div1 ID.
Save the file to see the results in you web browser. The spacing has increased from our text - to the perimeter of the
Increase the padding to 20px to see the difference.
Now let’s add 30px padding to only the top and left.
padding: 30px 0px 0px 30px;