Horizontal fields will never get a chance to collapse, because the rules that govern the squeezing of the edges mean that they can never satisfy the conditions.
In CSS, adjacent fields of two or more boxes (which may or may not be siblings) can combine to form a single stock. It is believed that the fields that are combined in this way are collapsing, and the resulting combined stock is called a compensated stock.
Collapsing fields ( http://www.w3.org/TR/CSS21/box.html#collapsing-margins )
Attaching fields can only be block:
Two fields are adjacent if and only if:
- both refer to block blocks in a stream that participate in the same block formatting context.
Collapsing fields ( http://www.w3.org/TR/CSS21/box.html#collapsing-margins )
And the fields only collapse if they are not placed or absolutely not placed:
- Fields between a floating field and any other field are not collapsed (even between a float and child streams).
- Fields of elements that create new block formatting contexts (such as float and elements with "overflow" except for "visible") are not collapsed with their children in the stream.
- The fields of absolutely placed boxes do not collapse (even with their children in the stream).
Collapsing fields ( http://www.w3.org/TR/CSS21/box.html#collapsing-margins )
This means that the blocks of the block level can never be located on the same line horizontally (since the blocks by default will automatically start on a new line by default) and at the same time fulfill the conditions of compression of the edges.
Theoretically, inline fields can satisfy conditions, but since they are not block-based, rules do not apply to them at all.
In the context of formatting formatting, fields are laid out horizontally, one after another, starting from the top of the containing block. Horizontal fields, borders, and padding are respected between these fields.
Formatting Contexts ( http://www.w3.org/TR/CSS21/visuren.html#block-formatting )
However, the simple reason they donβt collapse is because the W3C said this:
Horizontal fields are never destroyed.
Collapsing fields ( http://www.w3.org/TR/CSS21/box.html#collapsing-margins )