Re: floating p's with address's in them
- From: Ben C <spamspam@xxxxxxxxx>
- Date: Thu, 11 Oct 2007 08:51:15 -0500
On 2007-10-11, Chris Beall <Chris_Beall@xxxxxxxxxxx> wrote:
John Hosking wrote:
(snip)
[1]I did not know this and have deduced it by analyzing your question. I
find the W3C docs to be obscure in some areas; this is one of them. I
don't know how to tell what elements are block-level.
John,
In W3Cese at http://www.w3.org/TR/CSS21/visuren.html#block-boxes
"Block-level elements are those elements of the source document that are
formatted visually as blocks (e.g., paragraphs). Several values of the
'display' property make an element block-level: 'block', 'list-item',
and 'run-in' (part of the time; see run-in boxes), and 'table'."
Yes but don't confuse that with the HTML concept of a "block-like
element".
According to the HTML DTD, certain HTML elements are "block-like":
<!ENTITY % block "P | %heading; | %list; | %preformatted; | DL | DIV |
NOSCRIPT | BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
which includes ADDRESS.
Of course any element can be made display: block, or display: inline, or
whatever you want using CSS. But that doesn't alter whether for the
purposes of HTML it's "block-like" or not.
<p style="display: inline">
is an HTML block, but a CSS inline.
<span style="display: block">
is an HTML inline, but a CSS block.
Since ADDRESS is a block, it is invalid inside a P. That means the
browser's "Broken HTML" support kicks in and probably closes the P as
John Hosking was thinking. (Although it currently isn't defined what it
does.)
CSS on the other hand, doesn't care how display types are nested. It
defines how anonymous (block, inline and table family) boxes are
generated to make any nesting work. But the CSS renderer only gets to
see the output of the parser. If the HTML is invalid it will typically
have been patched up first and the CSS renderer will see a different
structure of elements.
.
- Follow-Ups:
- Re: floating p's with address's in them
- From: John Hosking
- Re: floating p's with address's in them
- References:
- floating p's with address's in them
- From: yawnmoth
- Re: floating p's with address's in them
- From: John Hosking
- Re: floating p's with address's in them
- From: Chris Beall
- floating p's with address's in them
- Prev by Date: Re: floating p's with address's in them
- Next by Date: Re: making div's the same size as one another
- Previous by thread: Re: floating p's with address's in them
- Next by thread: Re: floating p's with address's in them
- Index(es):
Relevant Pages
|