Re: Containing block for absolutely positioned elements

/Irene Vatton/:

> But I don't understand what rule says that the last div is smaller than 
> others.

10 Visual formatting model details
10.3 Calculating widths and margins
10.3.7 Absolutely positioned, non-replaced elements 
<http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width> 
(little down below):

>    1. 'left' and 'width' are 'auto' and 'right' is not 'auto', then the 
> width is shrink-to-fit. Then solve for 'left'
> [...]
>    3. 'width' and 'right' are 'auto' and 'left' is not 'auto', then the 
> width is shrink-to-fit . Then solve for 'right'
> [...]
> Calculation of the shrink-to-fit width is similar to calculating the 
> width of a table cell using the automatic table layout algorithm. 
> Roughly: calculate the preferred width by formatting the content 
> without breaking lines other than where explicit line breaks occur, 
> and also calculate the preferred minimum width, e.g., by trying all 
> possible line breaks. CSS 2.1 does not define the exact algorithm. 
> Thirdly, calculate the available width: this is found by solving for 
> 'width' after setting 'left' (in case 1) or 'right' (in case 3) to 
> 0.
> 
> Then the shrink-to-fit width is: min(max(preferred minimum width, 
> available width), preferred width).

-- 
Stanimir

Received on Wednesday, 31 August 2005 18:14:20 UTC