At 09:56 AM 9/17/2004, Ted Drake wrote:
p {margin: 1em 0 1em;padding: 0; text-align: left; width:90%;}
img {border:0;}
#maincontent img {float:right; margin:3px;}

When I view this in mozilla the paragraph wraps nicely but the IE paragraph acts as if it has cleared and starts after the image.
...
I then noticed the paragraph width tag and said to myself:
"Could it be the width:90% that is doing it? I added the width to keep the paragraphs from getting too long."


I then commented out the width and checked, sure enough IE began playing nicely. So, how do I get the good browsers to show the narrower paragraphs and IE the nicely floated image?


Ted,

Ironically, the way IE is behaving appears to be according to the CSS2.1 spec:
http://www.w3.org/TR/CSS21/visuren.html#floats
(I don't see that particular example of a float defeated by too wide content in the CSS1 & CSS2 specs.)


This is actually the way I would have expected CSS to act, although maybe that's just my own inexperience talking. I'm under the impression that when you specify a width it overrides float requests. Note for example the way floated columns fall apart when their combined widths are even a pixel too wide for the window. The browsers are behaving

I would have expected your problem to be solved by declaring
        max-width: 90%

Regards,
Paul



****************************************************** The discussion list for http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to