Kabuki said:
Why though? If p and div are block level elements, shouldn't they behave
as per IE?
No, IE is alone and wrong on this. DIV and P are both block elements
and should flow around a flow if in normal flow. Consider a small
pull-quote and a long paragraph...
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"
http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta http-equiv="content-language" content="en-us">
<title>Proper Float</title>
<style type="text/css">
.pullquote {
margin: 0 .5em 0 0; padding: .5em; float: left;
font: large sans-serif; color: #500; background: #eee;
}
.pullquote:before { content: open-quote; }
.pullquote:after { content: close-quote; }
</style>
</head>
<body>
<div class="pullquote">
Just a small pull quote...
</div>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut commodo
volutpat augue. Morbi hendrerit, lorem vel iaculis congue, orci est
vehicula mi, scelerisque hendrerit urna leo tempus justo. Integer
lacinia, dolor id lacinia pulvinar, lacus odio tempus mauris, sit
amet porta eros justo id mauris. Nam dolor erat, cursus non,
fringilla commodo, convallis scelerisque, massa. Duis ac ligula.
Nulla aliquet. Vivamus porttitor ligula dictum elit. Ut sagittis
pede non lectus. Ut interdum eleifend felis. Donec erat lectus,
venenatis at, accumsan non, eleifend ac, nibh. Praesent hendrerit
tempor eros. In vulputate fringilla felis.
</p>
</body>
</html>
Should look like
+------------+ +----------------+
| pull quote | | para.......... |
+------------+ | .............. |
+---------------+ .............. |
| .............................. |
| .............................. |
| .............................. |
+--------------------------------+
And not like this:
+------------+ +----------------+
| pull quote | | para.......... |
+------------+ | .............. |
| .............. |
| .............. |
| .............. |
| .............. |
+----------------+
If I float ex2 left too (works yes but seems counterintuitive), I get
the problem in FF2 similar to this page:
No, now ex2 is not in normal flow, but floated
http://members.shaw.ca/laplanteco/test/index2.htm
i.e. extra padding on the top of the div, above the image.
Not sure what that proves