HTML and CSS Reference
Next, you'll change the left margins for the horizontal navigation list and the presi-
dent's message so they are offset from the page's left edge by 33% of the page body
width. You'll also resize the width of the navigation list to 66% of the total page width.
To change the margin spaces in the page:
1. Return to the cp_styles.css style sheet file in your text editor, and then directly
below the comment Horizontal Navigation List add the following style rule:
2. Scroll down to the style rule for the president's message and add the following style:
Figure 4-27 highlights the new and revised styles in the style sheet.
Setting left margins
sets the width of the
navigation list to 66%
of the page width and
the left margin to 33%
of the page width
sets the left mar gin to
33% of the page width
3. Save your changes to the file and then reload cycle.htm in your Web browser.
Figure 4-28 shows the revised layout of the page.
Revised page layout
page content in the remaining
66% of the page width
33% left margin
Margin styles also can be applied to the body element. For example, by setting the
margin around the page body to 0 pixels, you can remove the extra space many brows-
ers insert by default between the page content and the edge of the browser window.