Floating objects.

Discussion in 'HTML' started by Andrew Fedoniouk, Aug 8, 2003.

  1. <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?

    Can I describe text as sequence of words taken from consequent paragraphs,
    where paragraph boundaries just sort of LF or <BR> ?

    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.

    If now, what does text mean exactly? Could somebody point on formal
    description?

    And I guess that "floated to one side of the page" is not a case anymore.

    Are these problems of non-deterministic standard or rather existing
    browsers?

    Could somebody shed a light on this part of standard?

    Thanks in advance.

    Andrew Fedoniouk.
    http://terra-informatica.org
    http://blocknote.net
    Andrew Fedoniouk, Aug 8, 2003
    #1
    1. Advertising

  2. Andrew Fedoniouk

    Chris Beall Guest

    "Andrew Fedoniouk" <> wrote in message
    news:GrBYa.56989$...
    > <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
    Chris Beall, Aug 8, 2003
    #2
    1. Advertising

  3. Andrew Fedoniouk

    Chris Morris Guest

    "Andrew Fedoniouk" <> writes:
    > PS: It seems that HTML standard itself is just one big deprecated block of
    > text. You can use just one tag, lets say DIV and apply various styles to it.


    Yes, you *can*. But in old HTML you *could* use <font> and <br> to do
    almost as much damage to your document.

    > example is here: http://www.blocknote.net/tests/31.htm (table there will
    > fail on IE 6.0)
    > What is the point of doctype declarations as CSS allows you completely avoid
    > DTD (in terms of structure: which element can contain another)?


    CSS is optional.

    <div class="looklikeh1">My Page</div>

    <div class="looklikep">My Paragraph <span class="looklikestrong">has
    emphasis</span></div>

    :: In CSS supporting browser

    *My Page*

    My Paragraph *has emphasis*

    :: In non-CSS supporting browser

    My Page
    My Paragraph has emphasis


    HTML is a language for describing the structure of the document - so
    if there's an element that exists that has the desired meaning, it
    should be used in preference to a generic element such as <div> or
    <span>.
    http://www.dur.ac.uk/ITS/WWW/accessibility/guidelines/priority2/structural.php

    <h1>My Page</h1>
    <p>My Paragraph <strong>has emphasis</strong></p>

    --
    Chris
    Chris Morris, Aug 8, 2003
    #3
  4. Hi Chris.

    Agreed with you by(on?) 100% !

    My point: standard must force to use e.g. <EM> instead of anything else. It
    just shouldn't allow to do that.
    And FONT by the way. In those cases when changing font color for example
    does not have any semantic meaning.

    And what is it style="display:table"? What for? Where we are going to use
    it? With which tag?

    XML+CSS is our future? We are loosing letter 'T' in the word HTML....

    Andrew Fedoniouk.
    http://terra-informatica.org
    http://blocknote.net



    "Chris Morris" <> wrote in message
    news:...
    > "Andrew Fedoniouk" <> writes:
    > > PS: It seems that HTML standard itself is just one big deprecated block

    of
    > > text. You can use just one tag, lets say DIV and apply various styles to

    it.
    >
    > Yes, you *can*. But in old HTML you *could* use <font> and <br> to do
    > almost as much damage to your document.
    >
    > > example is here: http://www.blocknote.net/tests/31.htm (table there will
    > > fail on IE 6.0)
    > > What is the point of doctype declarations as CSS allows you completely

    avoid
    > > DTD (in terms of structure: which element can contain another)?

    >
    > CSS is optional.
    >
    > <div class="looklikeh1">My Page</div>
    >
    > <div class="looklikep">My Paragraph <span class="looklikestrong">has
    > emphasis</span></div>
    >
    > :: In CSS supporting browser
    >
    > *My Page*
    >
    > My Paragraph *has emphasis*
    >
    > :: In non-CSS supporting browser
    >
    > My Page
    > My Paragraph has emphasis
    >
    >
    > HTML is a language for describing the structure of the document - so
    > if there's an element that exists that has the desired meaning, it
    > should be used in preference to a generic element such as <div> or
    > <span>.
    >

    http://www.dur.ac.uk/ITS/WWW/accessibility/guidelines/priority2/structural.p
    hp
    >
    > <h1>My Page</h1>
    > <p>My Paragraph <strong>has emphasis</strong></p>
    >
    > --
    > Chris
    Andrew Fedoniouk, Aug 9, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bigbinc
    Replies:
    3
    Views:
    399
    Michael Borgwardt
    Nov 18, 2003
  2. Simon Elliott

    Inheritance of objects within objects

    Simon Elliott, Dec 10, 2004, in forum: C++
    Replies:
    2
    Views:
    331
    Simon Elliott
    Dec 10, 2004
  3. 7stud
    Replies:
    11
    Views:
    689
    Dennis Lee Bieber
    Mar 20, 2007
  4. Replies:
    12
    Views:
    537
    James Kanze
    Jan 20, 2008
  5. teeshift
    Replies:
    2
    Views:
    254
    Chris Pearl
    Dec 1, 2006
Loading...

Share This Page