Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Float problem MSIE6.0 only

Reply
Thread Tools

Float problem MSIE6.0 only

 
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-24-2005
While overhauling website to PHP and rid dependency of JavaScript for my
navigation, I decided to update the CSS and some legacy table layouts
on some pages. All seems fine except floated picture boxes fail only in
MSIE6.0, The funny thing is looks fine in MSIE5.5 and 5.0! Here is a
test page to illustrate the problem, the image boxes in 6.0 to not float
left and right but span the whole content div...

http://www.littleworksstudio.com/temp/debug.html

Of course it looks correct in Opera, Moz, FF, Konq... and IE 5.5 5.0.
Cannot seem to find the culprit or is my IE the problem. Dumped cache
and rebooted but problem persists. Put pertinent style on the demo page.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-24-2005
Jonathan N. Little wrote:

> While overhauling website to PHP and rid dependency of JavaScript for my
> navigation, I decided to update the CSS and some legacy table layouts on
> some pages. All seems fine except floated picture boxes fail only in
> MSIE6.0, The funny thing is looks fine in MSIE5.5 and 5.0! Here is a
> test page to illustrate the problem, the image boxes in 6.0 to not float
> left and right but span the whole content div...
>
> http://www.littleworksstudio.com/temp/debug.html
>
> Of course it looks correct in Opera, Moz, FF, Konq... and IE 5.5 5.0.
> Cannot seem to find the culprit or is my IE the problem. Dumped cache
> and rebooted but problem persists. Put pertinent style on the demo page.
>

Damn! I found it! Been futzing with this way too long. It was the margin
specification to center the image within the div in case the caption
text pushed the div wider than the image and padding.

.pixbox IMG,
.pixboxL IMG,
.pixboxR IMG {
display: block;
margin-left: auto; <- the problem
margin-right: auto; <- the problem
}

I guess it is not too important if the text push the image off center.

+--------------+
| [IMAGE] |
| Caption text |
+--------------+

Or is there another way that MSIE6 will not balk?

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
 
rf
Guest
Posts: n/a
 
      10-24-2005
Jonathan N. Little wrote:

> All seems fine except floated picture boxes fail only in
> MSIE6.0,


Floated elements must have a width. In the absense of one IE6 assumes 100%,
FF (for example) assumes the width of the widest thing inside the element
(your picture).

> The funny thing is looks fine in MSIE5.5 and 5.0!


No, not funny at all. You are running IE6 in "standard compliant" mode, so
its box model is broken in an entirely different way to IE5.x.

Temporarily take out the doctype, putting IE6 in quirks mode. It will then
behave like IE5.x (well, sort of).

--
Cheers
Richard.
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      10-24-2005
rf wrote:
> Jonathan N. Little wrote:
>
>
>>All seems fine except floated picture boxes fail only in
>>MSIE6.0,

>
>
> Floated elements must have a width. In the absense of one IE6 assumes 100%,
> FF (for example) assumes the width of the widest thing inside the element
> (your picture).
>


Ah but the same would be true for my drop caps where the div's width is
defined by the width of the containing character + padding, but it does
not expand like the picture boxes in IE6. No, I found the culpit it was
using margins within to center the image if the text pushed the div box
wider.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
float to string to float, with first float == second float Carsten Fuchs C++ 45 10-08-2009 09:47 AM
operator== (float, float) Jukka Lehtonen C++ 5 08-05-2004 08:28 AM
need code to convert float format to internal java float format which is kept in 4 bytes integer Andy Java 7 05-10-2004 09:26 PM
static_cast<float>(a) versus float(a) Jim West C++ 4 01-16-2004 12:36 PM
Re: float->byte->float is same with original float image. why float->ubyte->float is different??? bd C Programming 0 07-07-2003 12:09 AM



Advertisments