View video tutorial
CSS Padding Side
CSS
Define the space between the element content and element boundary in any direction.
CSS Padding
Padding can be set on each side of an element.
The following properties specify the padding for each side of an element.
padding-top
padding-right
padding-bottom
padding-left
Example
.p1 {
padding-top: 50px;
padding-right: 30px;
padding-bottom: 50px;
padding-left: 80px;
}
Click on the "Try it Now" button to see how it works.
Sample Code
Copy each file contents and paste it to your own project and run to see the final output
Example
button {
padding-top: 15px;
padding-right: 20px;
padding-bottom: 15px;
padding-left: 20px;
}
Click on the "Try it Now" button to see how it works.