Controlling the Body of Your Page

In HTML documents, all displayable elements are nested inside of the BODY element (between the <body> start tag and the </body> end tag). By setting a style rule for the BODY element, you can control the global characteristics of your page, such as the page margins, the default font, and the foreground and background colors, for instance.

Setting the Page Margins

Using styles, you can control all four margins on your page. To set the width of all four margins, just type the following bold text:

<style type="text/css">
body {  margin-top: 25px; margin-bottom: 25px; margin-left: 25px; margin-right:
							25px; }
</style>

To check this out in your browser, first resave kochanski.html—in most cases, you can just select ...

Get Cascading Style Sheets (CSS) by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.