W3C home > Mailing lists > Public > www-style@w3.org > December 2014

Re: [css-grid] Absolutely positioned grid items

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 18 Dec 2014 11:52:05 -0800
Message-ID: <CAAWBYDD+KVOpfR7=yhmJgGx-uYxrn86WR_h60tavOcfSc=-EOQ@mail.gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:49 UTC