Re: Fixed-in-parent

On 08/08/2011 10:24 PM, Tab Atkins Jr. wrote:
> On Mon, Aug 8, 2011 at 8:40 PM, Jonas Sicking<jonas@sicking.cc>  wrote:
>> Hi all,
>>
>> There's a layout pattern I'm starting to see on more an more web pages
>> (and in some UI) that CSS is currently lacking support for, but that I
>> think would be nice to add.
>>
>> One example is:
>> http://www.yelp.com/search?find_desc=sushi&ns=1&rpp=10&find_loc=San+Francisco%2C+CA
>
> Yup, this is a really useful pattern.

See also
   http://lists.w3.org/Archives/Public/www-style/2009Dec/0155.html

> The Positioned Layout draft on my blog
> <http://www.xanthir.com/blog/b48H0>  addresses this more generally.  To
> do something like "fixed in parent", you'd do this:
>
> .fixed-in-parent {
>    position: relative; /* or absolute, whatever */
>    position-root-top: bottommost(self top, window top);
>    position-root-right: leftmost(self right, window right);
>    position-root-bottom: topmost(self bottom, window bottom);
>    position-root-left: rightmost(self left, window left);
>    top: 0; right: 0; bottom: 0; left: 0;
> }
>
> Hmm, feels like I need to add some magic to make this sort of thing
> less verbose.

.fixed-in-parent {
   position: persistent; /* do magic */
}

~fantasai

Received on Tuesday, 9 August 2011 06:30:02 UTC