This example demonstrates how to set the bottom margin in percent, relative to the width of the containing element:
HTML file: | Displayed by browser: |
---|---|
<style>
p.ex { margin-bottom: 25%; } </style> <body> <p>A paragraph with no specified margins.</p> <p class="ex">This is a paragraph with a specified bottom margin.</p> <p>A paragraph with no specified margins.</p> </body> |
A paragraph with no margins specified. This is a paragraph with a specified bottom margin. A paragraph with no margins specified. |