|
Posted by Andy Dingley on 10/10/06 11:22
Joe (GKF) wrote:
> HTML comes in two basic types; Block and Inline.
The problem with that is that you're (reasonably) categorised two
values that apply to three distinct properties and (unreasonably)
described these as a single property.
"HTML elements have a 'type' [block / inline]" is a useful intermediate
step as a tutorial because it introduces the concept of these distinct
states. However it's only a crude approximation - the element actually
has a "type that it is", a "types it can contain" and a "CSS display
behaviour" (which is easily changed by CSS). If you teach this concept
as the single property applying to all, then you have to make it clear
pretty soon afterwards that you've used a simplification, then to
explain further.
I use this simple explanation in teaching courses, but I wouldn't use
it on a web page without expanding it properly further down that same
page. In particular note that the HTML behaviour is fixed by the DTD,
but that the CSS behaviour is flexible. This is why we make complex
inline lists from <li> ("block elements") and making them look like
inline, rather than by taking already-inline <span>s and squeezing
invalid block elements into them.
Toby's somewhat pathological case of "bizarre nesting via object" is
IMHO not such a big deal. It's genuine, but sufficiently rare that I
wouldn't worry about that one.
[Back to original message]
|