On 2008-03-29,
liketofindoutwhy@gmail.com <liketofindoutwhy@gmail.com> wrote:
> i found that there is a rule regarding "pure space" directly inside a
> block element or directly inside an inline element. For the following
> example, in compliance strict mode:
>
><body>
>
> <div>
>
> hello
> world
>
> </div>
>
>
>
> <div>
>
> <img src="pic.jpg">
> <img src="pic.jpg">
>
> </div>
>
>
></body>
>
> there are tons of spaces after the first <div>, and they are the
> newline and space characters. But none is honored. None is rendered.
It all gets collapsed to one space. Try setting white-space: pre on body
and you should see all your spaces.
[...]
> This seems like the rule, applicable on IE7, Firefox 2, and Safari 3.
> This being the general rule it seems, does the spec actually say
> something about this?
See CSS 2.1 16.6.1 which explains how white-space is collapsed.