Re: :first pseudo-selector

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 UTC