Re: [css-grid] Absolutely positioned items and static position

On 26/11/14 23:07, Manuel Rego Casasnovas wrote:
> On 26/11/14 19:52, Tab Atkins Jr. wrote:
>> Ooh, we don't really specify the static position of absposes with grid
>> container parents.  Hmm.  Yeah, I guess that (A) falls out of the
>> definition, and is consistent with our answer if you specify offsets.
> 
> So trying to be more explicit. Imagine the following grid:
> <style>
>   .grid {
>     display: grid;
>     grid-template-columns: 100px 100px;
>     grid-template-rows: 50px 50px;
>     position: relative;
>     padding: 15px;
>     width: 500px;
>     height: 500px;
>   }
> 
>   .absolute {
>     position: absolute;
>     width: 100%;
>     height: 100%;
>   }
> 
>   .offset {
>     left: 0;
>     top: 0;
>   }
> 
>   .area {
>     grid-row: 2 / 3;
>     grid-column: 2 / 3;
>   }
> 
>   .span {
>     grid-row: span 2;
>     grid-column: span 2;
>   }
> </style>
> 
> <div class="grid">
>   <div id="item"></div>
> </div>
> 
> The positions and sizes of the #item depending on the class would be:
> * class "absolute" position 15x15 size 530x530.
> * class "absolute offset" position 0x0 size 530x530.
> * class "absolute area" position 115x65 size 100x50.
> * class "absolute offset area" position 115x65 size 100x50.
> * class "absolute span" position 15x15 size 530x530.
> * class "absolute offset span" position 0x0 size 530x530.

And one extra case:
.auto {
  grid-row: auto / 3;
  grid-column: auto / 3;
}

* class "absolute auto" position 15x15 size 215x115.
* class "absolute offset auto" position 0x0 size 215x115.

My doubt here is regarding the position of "absolute auto". I'm not sure
if it should be 15x15 or 0x0.

Thanks,
  Rego

Received on Thursday, 27 November 2014 11:42:14 UTC