Copyright © tutorialspoint.com

CSS - padding-top

previous next


Description:

The padding-top property sets the width of the padding on the top of an element.

Possible Values:

Applies to:

All the HTML elements

DOM Syntax:

object.style.paddingTop="10px;";

Example:

Here is the example:

<p style="padding-top: 15px; border:1px solid black;">
This is a paragraph with a specified top padding
</p>

<p style="padding-top: 5%; border:1px solid black;">
This is another paragraph with a specified top padding in percent
</p>

This will produce following result:

This is a paragraph with a specified top padding

This is another paragraph with a specified top padding in percent

To Become more comfortable - Do Online Practice


previous next

Copyright © tutorialspoint.com