Web development

CSS padding-top Property

CSS padding-top Property

The space between the content and its border is named padding.

The CSS padding-top property settles the top padding (top space) of an element.


Click the “Try it” button to change the padding-top property of the paragraph (45px):

This is a paragraph.


padding-top: length;

length – defines fixed top padding in px, cm, etc.


<!DOCTYPE html>
.ex1 {
  border: 1px solid #333; 
  padding-top: 15px;

<p class="ex1">This is a paragraph with a 15px top padding.</p>



This is a paragraph with a 15px top padding.

Enjoy coding!

Read also:

CSS margin-top Property

CSS border-top Property

CSS clear Property