3 May 2005 joolean   » (Journeyer)

Maybe I was naive or didn't read the spec closely enough to grok these things immediately, but here are a couple of CSS details that took me a long time to get my mind around. Maybe they'll save you some fretting when you're doing some CSS-related programming.

1. CSS doesn't squish content! References to the wisth od the containing block are only for resolving lengths specified in terms of percentages. This also means that you're perfectly free to specify percentages in excess of 100% or percentages for the various width / height components that add up to more than 100%. If the requested / required size of content is greater than that available in the containing block it just spills out or gets cropped, depending on the 'overflow' property for that block.

2. This is a trivial point, but the 'width' property only specifies the width allotted to the element's content -- the total width of the element also includes border width, padding, margins, and outline.

3. CSS tables provide display-types for both columns and rows, so you might be inclined to think that you can specify table cells as the children of either, but you can't -- only rows can contain cell elements. Columns (and column groups) can only be used to specify properties that get inserted into the cascade for cells in the appropriate positions in their respective rows.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!