Positioning Styles

Page layout in CSS involves creating the illusion of columns and spatial organization of a page, without HTML tables.

The most important things to know for CSS positioning are your page element dimensions (how wide, how tall) and which elements (like your content) will be different from page to page, depending on the content.

A Note About Margins

Margins can cause positioning to behave in ways you might not expect. For example, a margin-top: value on an <h2> tag appearing immediately inside and at the top of <div id="content"> will actually appear to push the entire content division down--rather than simply moving the heading down. Use padding-top: on either the h2 element, or on the top of the content division, to create space between the edge of the division and, in this example, the heading two.