W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2000

Re: HTML Tidy bug (general) + Mac Tidy (BBTidy) suggestion

From: Mr Israel Steinmetz <MrData@mail.com>
Date: Mon, 01 May 2000 00:10:32 -0400
Message-ID: <390D03B8.7E64A614@mail.com>
To: Stanton McCandlish <mech@eff.org>
CC: html-tidy@w3.org, teague@mailandnews.com
Dear Stanton McCandlish,

Tidy is acting properly, here. The SPAN element is, indeed, an inline
element. Since you are talking about HTML 4.01, in particular, you can
find the relevant information at <URL:
http://www.w3.org/TR/html401/struct/global.html#h-7.5.4 >.

It's unfortunate for your purposes that the DIV element does commonly
cause a line break. But, considering that it is actually a block level
element, this does make some sense.

When I'm in a situation like yours, I generally use multiple inline
elements, one inside each block level element. This is unwieldy, but
technically correct. So, for example, each P block level element would
have its own SPAN inline element, since a SPAN element cannot contain P
block level elements.

The following example is easy to work with, but technically incorrect:
<SMALL><P>Paragraph 1</P><P>Paragraph 2</P></SMALL>

If we rework it, we have the correct:
<P><SMALL>Paragraph 1</SMALL></P><P><SMALL>Paragraph 2</SMALL></P>

If we rework your example in a similar way, we have:
<P><SPAN CLASS="x"><SPAN CLASS="y">text</SPAN></SPAN></P>

Question: Can you use style sheets to overcome the presentation problems
you're having with the DIV element? In fact, can't you set the display
property of the DIV element to inline, instead of block, so you do not
experience this problem? I think, the resulting CSS would be:
DIV ( display: inline )

(I haven't done much with style sheets, yet, so the above may not be
correct.)

Sincerely,
Israel Steinmetz, RingMaster
WebRings: Frames Free!, Golden HTML/XHTML Resources, Valid HTML/XHTML
http://www.noframes.org/webrings/
--

> I've managed to generate similar errors with other text+markup in the form:
> 
> <SPAN CLASS="x"><P><SPAN CLASS="y">text</SPAN></P></SPAN>
> 
> (That very example yields the same errors. Tidy doesn't realize that
> the first span is enclosing the <P>...</P>, and doesn't recognize that
> the second span has any attributes at all.)
> 
> I suppose one can argue that <SPAN>...</SPAN> is only intended to be
> used within block elements and never surrounding them, though I don't
> see that specified in the HTML 4.0.1 spec anywhere (and I'd have to
> argue against it if it is in there, since the element is widely used,
> and widely interpreted by agents, as having no such restriction, not to
> mention that <DIV>...</DIV> typically has undesirable spacing effects
> (linebreak before and after as if it were a <H#>...</H#>), leaving no
> real option but <SPAN>...</SPAN> for applying CLASS information w/o
> otherwise altering appearances, in many cases.

-- 
Enlightenment Essentials: Free Books, Searches, Politics, HTML
http://www.mrdata.net/
Received on Monday, 1 May 2000 00:11:22 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:43 GMT