Re: Containing block for absolutely positioned elements

/Stanimir Stamenkov/:
> /Irene Vatton/:
> 
>> But I don't understand what rule says that the last div is smaller 
>> than others.
> 
> 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'

In the example <http://stanio.info/containing_block.html> I've 
already given 'left' is not 'auto' (although not explicitly 
specified and its initial value is 'auto') because (before the rule 
list):

> If all three of 'left', 'width', and 'right' are 'auto': First set 
> any 'auto' values for 'margin-left' and 'margin-right' to 0. Then, 
> if the 'direction' property of the containing block is 'ltr' set 
> 'left' to the static position and apply rule number three below; 
> otherwise, set 'right' to the static position and apply rule number 
> one below.

-- 
Stanimir

Received on Wednesday, 31 August 2005 18:48:45 UTC