W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: :first pseudo-selector

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Fri, 23 Mar 2012 03:11:04 +0400
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-Id: <843101332457864@web58.yandex.ru>
23.03.2012, 02:44, "fantasai" <fantasai.lists@inkedblade.net>:
> On 03/22/2012 11:37 AM, Marat Tanalin | tanalin.com wrote:
>
>>> šIt's necessary if you have a box with some paragraphs and don't want to have unnecessary gaps at the the end and the beginning
>>> šof the box.
>> šAs far as I understand this part of message, it's something that I thought of too.
>>
>> šLet assume we have a container with blocks inside it, and each block can have margin-top and margin-bottom, and each block can contain another blocks inside them, and nesting level can be arbitrary and is unknown in advance.
>>
>> šIt would be nice to have ability to zeroize margin-top for first child, and first child of it, first child of first child of first child, etc. at once. Same applies for last child.
>
> This specific case would probably be better handled by some kind of margin-collapsing
> control, actually. Are there other cases where you'd need this kind of recursive
> selector?
>
> ~fantasai

Well, maybe. Though I have no idea what is that margin-collapsing has to do with margin-zeroing and how could it be expressed syntactically.

Main usecase for me is, indeed, zeroing vertical margins (mainly, to prevent margin-bottom on last-child element and all it's last children recursively). However it probably could have sense for other things like borders too.
Received on Thursday, 22 March 2012 23:11:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:53 GMT