Re: question about the BODY tag in the HTML DTD
On 8 Apr, 20:36, Bart Lateur <bart.lat...@pandora.be> wrote:
> What gives? Am I misunderstanding the spec, or a people doing it wrong?
This is correct (but just for 4 Strict, not 3.2 or Transitional) and
most coders do indeed use it wrongly.
The intention is a clear and simple one, if only you're aware of it.
%inline; elements are considered to be "bare" and without well-managed
container boxes, so shouldn't be placed naked onto a page.
You can even extend this attitude so that %inline; content shouldn't
be used in a %block; context in general. This isn't expressed in the
DTD, because most contexts accept %flow; rather than %block; alone.
However mixing inline and block elements as siblings is not a
recommended practice, certainly not at the higher scale of the DOM.
As a specific example, I often float <div> around on a page (image/
caption containers) to avoid the rigid grid look of simple CSS
layouts. It's also necessary to place a HTML element after these with
clear used to tidy up after the floating. I used to use a <br> for
this. That worked fine, and because they were all contained in overall
<div> anyway, it was even valid. However I now regard it as
inappropriate, so I use <hr> instead (with some CSS to make the usual
horizontal rule disappear).
|