CSS properties for CSS Positioning (CSSP) can be applied to particular objects.

The primary CSS properties for CSSP are position and float. Position has three possible values:

Once the position property is set to absolute or relative, set at least one of these style properties: bottom, left, right, and top. Positioned objects can overlap or under-lap objects at the new position using the z-index property.

The objects that support CSSP depend on the browser:

Fractions of block elements cannot be positioned. Either the whole block element gets positioned or nothing.

Block formatting involves boxes (elements, tags) that cause line breaks before and after itself, i.e. boxes are laid out vertically. Examples include <p>, <h1>, lists, and tables. Inline formatting involves boxes that are laid out horizontally. EG: Divisions and spans both mark sections of web pages but divisions (<div>) are block elements and spans (<span>) are not. That is, a span can be smoothly included within a paragraph but a division would add line breaks. For more see my section on HTML.

A float is a box that is shifted to the left or right on the current line with the float property. The width property of a floated box must be specified. The content float may be either a block or an inline block but the float property generates a block box. Content flows on the other side of a float, i.e. a box floated left will be shifted to the left and have content flowing on its right. When an object clears a side with the clear property, it increases its top margin until it clears an objects floated on the specified side. The order of floated boxes is relevant. EG: If 2 boxes are both floated left, then the 2nd one will be displayed left most.

There are many tricks that can be done with CSSP. [I used to have some examples but I made them long ago and they're way out of date. Plus there are many other good examples on the net.]

2007-08-15 17:55:52Z