Re: [css-grid] Absolutely positioned grid items

On Fri, Nov 7, 2014 at 8:59 AM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 11/07/2014 10:23 AM, Manuel Rego Casasnovas wrote:
>>
>> Hi,
>>
>> I've been trying to understand how abspos items should behave under
>> different conditions. We've 2 points in the specs talking about it:
>> * 4.3. Static Position of Grid Container Children [1]
>> * 8.4. Absolutely-positioned Grid Items [2]
>>
>> So, let me show some examples in order to try to understand how it
>> should work.
>>
>> * Example 1:
>> <div style="display: grid;">
>>    <div style="position: absolute;">Absolute</div>
>> </div>
>>
>> It seems to me that this particular case should work the same than if
>> the parent is a regular block.
>> If you set "left: 0px;" it'll move the item to the left border of the
>> viewport.
>> But, if you specify "justify-self: center;" in the abspos item, it'll be
>> centered within the grid container left and right padding edges.
>
>
> Yes.

Quick correction: No.  The 'justify-self' property will center the
abspos in its containing block.  The grid is not its containing block
in this example; the ICB is.  The abspos will be centered in the ICB
instead.

~TJ

Received on Thursday, 18 December 2014 19:52:52 UTC