473,721 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IE float bug?

I was experimenting with two column layouts, and at one point wrote
the code listed at the end of this message. IE and Mozilla have two
entirely different interpretations of what it does.

In IE6, the c1 divs are all lined up along the left side of the page.
The c2 divs are lined up along the right side of the page. Both
columns start at the top of the page.

In Mozilla (Firebird), c2 divs starts down the page next to the last
c1 div. This makes sense. The c1 divs are constantly clearing left,
which will affect the placement of the c2 divs. Is Firebird right in
this case? If so, isn't this a serious IE bug? (It isn't honoring
the clears).

- Trent

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<style type="text/css">
div
{
color : black;
font-weight : bold;
margin : 10px;
}

.c1
{
float : left;
clear : left;
background-color : #FFBBBB;
}

.c2
{

float : right;
clear : right;
background-color : #BBFFBB;
}

</style>

</HEAD>

<BODY>
<div class="c1">
My div c1<br>
My div c1<br>
My div c1<br>
My div c1<br>
</div>
<div class="c1">
My div c1<br>
My div c1<br>
My div c1<br>
My div c1<br>
My div c1<br>
</div>

<div class="c1">
My div c1<br>
My div c1<br>
My div c1<br>
My div c1<br>
My div c1<br>
My div c1<br>
</div>

<div class="c2">
My div c2<br>
</div>

<div class="c2">
My div c2<br>
My div c2<br>
My div c2<br>
My div c2<br>
My div c2<br>
</div>

<div class="c2">
My div c2<br>
My div c2<br>
My div c2<br>
My div c2<br>
</div>
</BODY>
</HTML>
Jul 20 '05 #1
5 2999
> In IE6, the c1 divs are all lined up along the left side of the page.
The c2 divs are lined up along the right side of the page. Both
columns start at the top of the page.
Opera does the same as IE6.
In Mozilla (Firebird), c2 divs starts down the page next to the last
c1 div. This makes sense. The c1 divs are constantly clearing left,
which will affect the placement of the c2 divs.


The IE and Opera behaviour seems more intuitive to me which probably that
means Mozilla is correct ;-)

By the way aren't floated boxes supposed to have explicit widths unless they
are something like an image? It doesn't seem to make any difference to the
behaviour here but it ought to be mentioned.

Jul 20 '05 #2
Graham J wrote:
By the way aren't floated boxes supposed to have explicit widths unless they
are something like an image?


In the CSS 2.1 draft this has changed to "shrink to fit", recent
browsers have changed their behaviour in anticipation of this change.

This new method makes a lot more sense and the new browser behaviour
should not cause backward compatibility problems since a specified width
will override a derived width.

--
Spartanicus
Jul 20 '05 #3
Spartanicus wrote:
Graham J wrote:

By the way aren't floated boxes supposed to have explicit widths unless they
are something like an image?

In the CSS 2.1 draft this has changed to "shrink to fit", recent
browsers have changed their behaviour in anticipation of this change.


I thought CSS2.1 was written towards browser behavior (which, sometimes,
makes more sense).
--
Anne van Kesteren
<http://www.annevankest eren.nl/>
Jul 20 '05 #4
On Fri, 19 Dec 2003 07:26:28 +0100, Anne van Kesteren
<ma**@annevanke steren.nl> wrote:
Spartanicus wrote:
Graham J wrote:
By the way aren't floated boxes supposed to have explicit widths
unless they are something like an image?
In the CSS 2.1 draft this has changed to "shrink to fit", recent
browsers have changed their behaviour in anticipation of this change.


I thought CSS2.1 was written towards browser behavior (which, sometimes,
makes more sense).


In this case, the errata to CSS 2.0 mentions shrink-wrapping, I'm not sure
if that was before or after MSIE implemented this. Mozilla was in flux at
the time, and adapted to errata quickly. Opera 4 had implemented the rules
just like the CSS 2.0 spec said, and didn't rewrite its rendering engine
each time an errata was added to the spec. Only in Opera 7 did
shrink-wrapping of positioned and floated boxes get fully implemented.

CSS 2.1 incorporates all the errata to CSS 2.0, *and* makes further
changes to describe better what (should) happen in browsers.

--
Rijk van Geijtenbeek

The Web is a procrastination apparatus:
It can absorb as much time as is required to ensure that you
won't get any real work done. - J.Nielsen
Jul 20 '05 #5
Anne van Kesteren wrote:
In the CSS 2.1 draft this has changed to "shrink to fit", recent
browsers have changed their behaviour in anticipation of this change.


I thought CSS2.1 was written towards browser behavior (which, sometimes,
makes more sense).


I don't know who "changed" first (spec/UA), but the CSS 2.1 draft for
certain contains more than changes to bring the spec more in line with
UA implementations/behaviour such as the much needed new inline-block
property.

--
Spartanicus
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1876
by: Pat | last post by:
Give two double-typed variable X and Y. If (X==Y) is true, then how about the following results: (float(X) > float(Y))? (float(X) < float(Y))? (float(X) >= float(Y))? ( X > float(Y) )? ( X < float(Y) )?
14
2714
by: Glen Able | last post by:
Should it be possible to create a custom class, 'Float', which would behave as a drop-in replacement for the builtin float type? As mentioned in another thread, I once tried this in rather a hurry to try and catch some floating point naughtiness, but was stumped in various places. Is there a fundamental obstacle to doing this? thanks, G.A.
16
2556
by: Gerald Lafreniere | last post by:
{ float F=123.456000; F*=1000; // Actually I used a for loop F*=10 three times. printf("%f\n", F); } This will produce something like 123456.00XXXX, where XXXX are garbage digits. Why is this happening, and how do I get rid of it? (using Dev-C++
6
2299
by: Dave win | last post by:
Hi all: I'm confused with the expression "(float *())". Book says that this is a cast. But, I have no idea of this expr. why could this expr ignore the variable??? Thanx!!!
9
2406
by: Sisyphus | last post by:
Hi, I have some software that does the following (in an attempt to determine whether the double x, can be represented just as accurately by a float): void test_it(double x) { float y = x; if(x == y) { printf("x can be represented precisely by a float\n"); }
11
2272
by: Marc Pelletier | last post by:
Hello, I am having trouble implementing the following callback: CNCSError CECWCompressor::WriteReadLine(UINT32 nNextLine, void **ppInputArray) where ppInputArray is a 3 by x array. The length of x is not known at compile time.
20
3138
by: ehabaziz2001 | last post by:
That program does not yield and respond correctly espcially for the pointers (*f),(*i) in print_divide_meter_into(&meter,&yds,&ft,&ins); /*--------------pnt02own.c------------ ---1 inch = 2.51 cm ---1 inch = 2.54/100 Meter ---1 yard = 3 feet ---1 feet = 12 inch
8
6091
by: vjnr83 | last post by:
Hi, I have a doubt: what is the difference between float **p and float *p? Thanks in advance, Vijay
13
6185
by: Shirsoft | last post by:
I have a 32 bit intel and 64 bit AMD machine. There is a rounding error in the 8th digit. Unfortunately because of the algorithm we use, the errors percolate into higher digits. C++ code is ------------------ b += (float)(mode *val); On 32 bit(intel , vs 2003, C++), some watch variables are
3
10664
by: Arnie | last post by:
Folks, We ran into a pretty significant performance penalty when casting floats. We've identified a code workaround that we wanted to pass along but also was wondering if others had experience with this and if there is a better solution. -jeff
0
8736
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9143
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8019
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4761
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3202
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2588
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2137
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.