"Andrew Fedoniouk" <an****@terra-informatica.org> wrote in message
news:Gr*********************@news2.telusplanet.net ...
<CITE
src="http://www.w3.org/TR/html401/present/graphics.html#h-15.1.3"> 15.1.3 Floating objects
Images and objects may appear directly "in-line" or may be floated to
one side of the page, temporarily altering the margins of text that may
flow on either side of the object.
</CITE>
What does it mean "text" and "margins of text" here?
Text is the visible words. They are displayed within established
margins. In your first paragraph, you have specified width=50%. That
establishes the margins within which the text will be displayed.
Can I describe text as sequence of words taken from consequent
paragraphs, where paragraph boundaries just sort of LF or <BR> ?
Not exactly. A paragraph starts with <p> and ends with the start of the
next block element, which could be another <p> or something else.
Although it is not required to end a paragraph with </p>, it is good
practice to do so. <br> does not end a paragraph, nor does LF in the
source.
If yes, I believe that results of rendering of the following:
http://blocknote.net/tests/30.htm is just wrong for IE, NS, Opera and
Amaya.
See below.
If now, what does text mean exactly? Could somebody point on formal
description?
Section 9.2.2 of the CSS2 specification, at
http://www.w3.org/TR/REC-CSS2/visuren.html#q7, is probably what you
want, but it won't make much sense out of context.
And I guess that "floated to one side of the page" is not a case
anymore.
Better wording would have been "floated TOWARD one side of the page".
It floats TO the current MARGIN, which may not be at the page edge (and
isn't in your test case.)
Also, the recommended method for requesting a float has changed (note
that the HTML align="right" is shown as a DEPRECATED example in the
paragraph you refer to, meaning there is now a better way, using CSS).
Still, the old way should work.
Are these problems of non-deterministic standard or rather existing
browsers?
The folks who wrote the standard intend it to be deterministic, up to a
point, beyond which they usually say 'is outside the scope of this
specifiecation". Sometimes they aren't as clear as needed; sometimes
implementors don't read carefully enough.
Could somebody shed a light on this part of standard?
Here's what I see:
- In IE 5.5 for Windows, the words 'one two three' appear together in
the upper left corner of the bordered <p> block, as expected. The image
appears against the right margin of that block, also as expected, since
the image is logically (at the time of the HTML 4.01 spec) INSIDE the
paragraph, but has been floated to the right. The top of the image is
positioned one line down from the top of the block. The spec says
"Floating objects generally begin a new line.", so that's consistent.
The second paragraph has no specified width, so the viewport (window)
width is used, thus the paragraph block extends clear across the page
and contains the text, as expected.
So, I think IE 5.5 does what you asked, as its developers interpreted
the spec.
- In Netscape 7.1, the results are different. The first paragraph box
is only one line high, containing the three words, and 50% of the screen
width. That's fine.
The floated image appears next (moving downward), in the same location
as for IE, but it is outside the bordered paragraph box, i.e. it has
been removed from the 'Normal' flow, (using CSS terminology), and
floated to the right margin (previously established by the paragraph
width).
Next comes the second paragraph box, which extends clear across the
page again, slipping UNDER the image. The text itself, however, cannot
pass the new right margin defined by the left side of the image, so it
spills to a second line.
So Netscape did the right thing too, just using a slightly newer
definition of 'right'.
The problem is twofold:
First, things change. One standard gets partially obsoleted by
another. Descriptions are clarified in response to incorrect browser
implementations.
Second, there are ambiguities in any communication. The W3C folks try
to be crisp, but there are economic pressures on browser developers to
deliver products quickly or with a bias toward their own proprietary
features. That may cause them to read too carelessly or with an
unanticipated bias.
The result is that the presence of standards has not produced browsers
that render every page consistently with each other, hence most of the
discussion on these fora.
What should you do? Get a basic understanding of HTML (which I think
you've done). Then go through the HTML spec again. EACH TIME you come
to something DEPRECATED, jump over to the CSS2 spec and learn how to do
it using today's technology. (The CSS1 spec wording isn't as crisp,
especially in the area you're looking at).
Oh, and put an appropriate <doctype> at the top of every HTML page. It
will tell the browser which version of HTML you are trying to use (which
may affect its behavior), and will allow you to run the page through the
W3C HTML validator (
http://validator.w3.org/).
Chris Beall