On Tue, 28 Mar 2006, Andreas Prilop wrote:
How many spaces should be displayed in
A <span style="display:none">x</span> B
between "A" and "B"? I notice that Mozilla displays one space
and Internet Explorer (5 & 6) displays two spaces.
Hmmm. Well, HTML4.01 section 9.1 is clearly relevant. There seem to
be two possible issues:
1. White space collapse. But in the *content* we have the "x"
situated between the two spaces, so the spaces are not adjacent in the
*content* (and surely this is what counts?). While the "x" is not
supposed to be *rendered*, it is still present as part of the
*content*, and I would have thought the HTML rules were supposed to be
applied accordingly, no?
2. White space adjacent to HTML tags. But this is stated in 9.1 to
affect white space immediately after a start tag, or immediately
before an end tag. HTML says don't rely on them (implying that they
might get suppressed by a browser).
In your example, however, there is neither, so item 2 should't be your
problem.
So I think you're entitled to expect two spaces.
Why is this important? Instead of "span", think of the "rp" element
in "Ruby markup": http://ppewww.ph.gla.ac.uk/~flavell/www/umusalu.html
The content of <rp> is usually hidden.
Indeed. And I got the results that I wanted (both with and without
the fallback behaviour) by taking care whether to put each space
inside or outside of the <rp> markup: example (spaces marked for the
benefit of those reading in monospaced ;-)
<ruby><rb>Rubana-cu </rb>
^
<rp>[[</rp><rt>dawn-ed</rt><rp>]] </rp></ruby>
^
In theory, though, either or both of those spaces could be suppressed
by the rules in 9.1 (obviously I'm not talking about the fact that the
second one is *supposed* to be suppressed by the CSS style of
"display:none" which applies to it when CSS is in effect). No matter
how I juggle them, I can't avoid the spaces coming either directly
after a start tag, or directly before an end tag, and still get the
desired results.
So I suppose in theory I ought to use there...?