Chapter 13 Creating Division-Based Layouts

To create a division

Creating Divisions

<div id="name">
</div>

where name is a unique ID within the document for each division.

To float a division to the left or right

Floating a Division to the Right or Left

<div id="name" style="float: left">

or

<div id="name" style="float: right">

To position a division absolutely with respect to the parent element

Positioning Divisions

<div id="name" style="position: absolute; top: n; left: n">

where n is the number of pixels of offset vertically and horizontally from the upper-left corner of the parent element.

To position a division offset from its natural position

Positioning Divisions

<div id="name" style="position: relative; top: n; left: n">

where n is the number of pixels ...

Get HTML and XHTML Step by Step 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.