Harlan Messinger wrote:
Els wrote:
yawnmoth wrote:
http://www.frostjedi.com/terra/dev/test.html
I'd like to have the colored boxes appear on the same line as "Test"
does. The div containing the colored boxes is defined as being inline,
yet doesn't seem to be acting as an inline element. I suspect the
floats in the images within the div may be contributing to the problem,
Floating elements are block level elements. Block level elements can't
be contained by inline elements.
Is that stated in the CSS spec? As far as HTML is concerned, what can
and can't be included inside a particular element is determined entirely
by the element tag name, without regard to any CSS display value being
applied to the element.
The two statements are correct:
"Floating elements are block level elements."
"Block level elements can't be contained by inline elements."
The first statement is from the CSS specs.
The second statement is from the HTML specs.
The second sentence/statement has no relevence in this example since it
does not apply here.
It was clarified for me a several weeks ago in this newsgroup (was
actually like pulling teeth) that the display value does not change the
inherent block or inline state of an element. What it does do, is to
only change the way that it is displayed.
The first statement is therefore misleading and should really, read:
"Floating elements are 'displayed' as block level elements."
For example, an image is an inline element, but when floated it is
displayed as a block, however it will always remain an inline element.
Incorporating the second statement, consider four elements;
span and img which are inline elements, and
div and p which are block elements
You may have span and/or img, whether display:block is set or not,
within a div or p, whether display:inline is set or not.
You may _not_ have a div or p, whether display:inline is set or not,
within a span, whether display:block is set or not.
--
Gus