Categories
CSS Web development

CSS padding-bottom Property

CSS padding-bottom Property

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

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

Demo:

Click the “Try it” button to change the padding-bottom property of the paragraph:



This is a paragraph.


Syntax:

padding-bottom: length;

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

Example:

<!DOCTYPE html>
<html>
<head>
<style>
p.ex1 {
  border: 1px solid #333; 
  padding-bottom: 15px;
}
</style>
</head>
<body>

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

</body>
</html>

Output:

This is a paragraph with a 15px bottom padding.


Enjoy coding!

Read also:

CSS margin-bottom Property

CSS border-bottom Property

CSS Outline