The Box

by Joe Gillespie — Oct 1, 2002

The CSS 'Box' is a bit like a table cell, it holds a block of text together and you can put images in it, or give it a background color or image with various options to repeat or not. You can give it a width and height and position it anywhere on the page, usually relative to the top left corner of the page - but not necessarily so. This is called 'absolute positioning' and is more reliable in browsers and editors.

'Relative positioning' allows for less rigid layouts but because of the interdependency of the positions of the elements, behaves like a house of cards. If one element collapses for some reason - an error in your coding or a browser bug - the whole page falls down.

This month, I'll ignore absolute and relative positioning and just stick to simple building blocks.

Del.icio.us Digg Technorati Blinklist Furl reddit Design Float