Padding-Top

This example demonstrates how to set the top padding of a <p> element.

HTML file: Displayed by browser:
<style>
p.padding {
   padding-top: 2cm;
}
p.padding2 {
   padding-top: 25%;
}
</style>
<body>
<p>This is a text with no top padding.</p>
<p class="padding">This text has a top padding of 2 cm..</p>
<p class="padding2">This text has a left padding of 25%.</p>
</body>

This is a text with no top padding.

This text has a top padding of 2 cm..

This text has a left padding of 25%.


Back button Table of Contents Next button