Re: floating p's with address's in them



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.
.



Relevant Pages

  • Re: Center-Aligning elements
    ... the images and their text ... You'd have similar problems if you were using float and CSS was turned ... The Strict HTML requirement is rather formal as such, ... CSS 2.1 for inline boxes, and so it's unclear where browsers are ...
    (comp.infosystems.www.authoring.html)
  • Re: Crippled or missing borders in IE 7
    ... point of HTML, but nowadays HTML is not supposed to describe ... Block-level, inline, and table-cell elements are not about ... you can have that, browsers will try to cope with this, ...
    (alt.html)
  • Re: Tweaking the style of child elements inline
    ... It's interesting if it is possible to use CSS rules for styling child ... An is not an inline element. ... Creating a clear separation of content from ... you can apply CSS directly to an HTML ...
    (comp.infosystems.www.authoring.html)
  • Re: Crippled or missing borders in IE 7
    ... point of HTML, but nowadays HTML is not supposed to describe ... Block-level, inline, and table-cell elements are not about ... It's talking about the display property. ...
    (alt.html)
  • Re: Firefox and Netscape padding top of unordered list
    ... The HTML is an ugly mess of div-itis, class-itis and inline styles. ... us anything about accomplishing layout with CSS. ...
    (comp.infosystems.www.authoring.stylesheets)