Because of my experience posting various places over the last couple of
weeks: I'm expecting to be greated with hostility for asking about
concepts instead of "practical" things, since that has been my
experience for years and decades. Maybe I'm projecting hostility. I
don't know. How can I ask about theory and concepts without offending
people? I'll just continue asking and cross my fingers:
According to the 2.1 spec, regarding block-level non-replaced elements
in normal-flow with block-level children (e.g. a div element with
display: static and a "p" child element):
1. Does the height property have a meaning when specified on elements
that have the viewport as their containing block and that are not the
root element?
Say I have a div element containing a "p" element, with style like:
div {
height: 100%;
}
and it's containing block is the browser window (the viewport), does the
height property have a meaning?
In http://www.w3.org/TR/CSS21/visudet.h...eight-property in the
prose about percentage values it says:
"... If the height of the containing block is not specified explicitly
(i.e., it depends on content height), and this element is not absolutely
positioned, the value is interpreted like 'auto'."
Is the viewport treated as a block that has it's height explicitly
specified?
The next sentence is:
"A percentage height on the root element is relative to the viewport."
I gather that means, it makes sense to set a percentage height on the
root element at least. But, what about percentage heights on block-level
elements that are not the root element but that have the viewport as
their containing block (that are non-replaced and in normal flow, e.g. a
div element with display: relative or no display property set)?
I would assume that the viewport is treated as though it has it's height
explicitly set, except that in my testing with mozilla, setting height:
100% is not causing the box to extend from the top of the viewport to
the bottom, and there is qualified text later that makes me think that
the height property is ignored on non-replaced normal flow elements,
i.e. the third paragraph in 10.6.3.
2. Are the effective margins of the topmost and bottommost block-level
child boxes included in the height of a non-replaced block-level element
in normal flow when those margins are collapsed with some other margin?
http://www.w3.org/TR/CSS21/visudet.html#normal-block
"If it.." [the non-replaced block-level element in normal flow with
overflow computing to visible] "...has block-level children, the height
is the distance between the top border-edge of the topmost block-level
child box that doesn't have margins collapsed through it and the bottom
border-edge of the bottommost block-level child box that doesn't have
margins collapsed through it."
I don't understand the part that reads "...the topmost block-level child
box that doesn't have margins collapsed through it".
I think it might be saying that the height property is ignored on
non-replaced etc. etc. elements, that have block-level children, and
that the height is derived from the height of the children plus their
margins, taking into considering any margin collapsing, but I'm not sure
what to make of the bit about the collapsed margins.
Does it mean that, the height of the topmost block-level child box and
it's effective margins are ignored if it has a top-margin that is
collapsed with it's own topmost block-level child box? It can't be...
What does it mean?
3. Do margins have a meaning on the root element?
Regarding the sentence after the quote above, in:
http://www.w3.org/TR/CSS21/visudet.html#normal-block
"However, if the element has a non-zero top padding and/or top border,
or is the root element, then the content starts at the top margin edge
of the topmost child.
Is it correct to say: the viewport has 0 width margins (or margins have
no meaning on the viewport), margins in general increase above and below
the height of a block (unless they are negative), and that margins
specified on the root element are ignored? If not, what am I missing?