Scott Povlot wrote:

> I hope that someone can explain to me what is
> happening in this case.  The paragraph with the yellow
> background should be pushed over by the float.  The
> text in it is moved over due to the float.  But the
> yellow background still continues behind the float
> box.  I think that the background and border should be
> moved by the float.
> 
> Here is the URL:
> http://test.nmra.org/education/achievement/def.html
> 
> Thanks for your help.
> 
> 
> Scott Povlot

Hi Scott

This is the expected behavior when a float and a paragraph interact together. 
The specs [1] have.

"Since a float is not in the flow, non-positioned block boxes created before 
and after the float box flow vertically as if the float didn't exist. However, 
line boxes created next to the float are shortened to make room for margin box 
of the float."

In other words the paragraph with the yellow background which comes after the 
float in the source expands the full width of the #content div and the "line 
boxes" which is the actual text (words) within the paragraph is offset by the 
float. A test [2] by Philippe Wittenbergh (a list member) shows this.

Since you have actually ask this question you may not understand the big 
dilemma with IE involving hasLayout and floats [3]. The list of bugs are 
endless and provide mailing list members with many years worth of interesting 
discussion. Looking at the style that you already have, the simplest solution 
is to add a new class p.firstnote.

#content p {
        line-height: 1.5em;
        margin: 0.5em 2em 1em 0;
}
p.note, p.firstnote {
        background-color: #ffffce;
        border: 1px solid #dcdcdc;
        font-size: 0.9em;
        padding: 5px;
}
#content p.firstnote {margin-right:220px;}

And change the class on the paragraph in question to firstnote.

[1] <http://www.w3.org/TR/CSS21/visuren.html#floats>
[2] <http://dev.l-c-n.com/IEW2-bugs/float-layout.php>
[3] <http://www.satzansatz.de/cssd/onhavinglayout.html#rev>

Kind Regards, Alan

<http://css-class.com/>

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to