This example demonstrates how to set the top margin of a text using a cm value:
HTML file: | Displayed by browser: |
---|---|
<style>
p.ex { margin-top: 2cm; } </style> <body> <p>A paragraph with no specified margins.</p> <p class="ex">A paragraph with a 2cm top margin.</p> <p>A paragraph with no specified margins.</p> </body> |
A paragraph with no margins specified. A paragraph with a 2cm top margin. A paragraph with no margins specified. |