473,378 Members | 1,346 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Right-floating in IE

Hello. I'm noticing strange behavior in the way that Internet Explorer
positions elements following an element that has been floated to the
right.
Here is a simple test:
<div style="width: 800px; background-color: #CEF;">
<div style="width: 200px; float: right; background-color:
#FF0;">width: 200px; float: right; background-color: #FF0;<br />
width: 200px; float: right; background-color: #FF0;<br />
width: 200px; float: right; background-color: #FF0;</div>
<p>Unstyled text. Unstyled text. Unstyled text.</p>
<div style="width: 600px; background-color: #F66;">width: 600px;
background-color: #F66;<br />
width: 600px; background-color: #F66;<br />
width: 600px; background-color: #F66;<br />
Firefox and Opera correctly float this div up below the unstyled
text. Internet Explorer pushes it below the div floated to the
right.</div>
</div>

It looks great in Firefox and Opera, but Internet Explorer (I'm using
version
6.0.2800) pushes the element down below the right-floated one.

If someone has seen this problem before and has an idea of what I could
be
doing wrong, I would appreciate input. Thanks!

Jul 6 '06 #1
3 1641
To further the education of mankind, da******@hotmail.com vouchsafed:
Hello. I'm noticing strange behavior in the way that Internet Explorer
positions elements following an element that has been floated to the
right.
Here is a simple test:
<div style="width: 800px; background-color: #CEF;">
<div style="width: 200px; float: right; background-color:
#FF0;">width: 200px; float: right; background-color: #FF0;<br />
width: 200px; float: right; background-color: #FF0;<br />
width: 200px; float: right; background-color: #FF0;</div>
<p>Unstyled text. Unstyled text. Unstyled text.</p>
<div style="width: 600px; background-color: #F66;">width: 600px;
background-color: #F66;<br />
width: 600px; background-color: #F66;<br />
width: 600px; background-color: #F66;<br />
Firefox and Opera correctly float this div up below the unstyled
text. Internet Explorer pushes it below the div floated to the
right.</div>
</div>

It looks great in Firefox and Opera, but Internet Explorer (I'm using
version
6.0.2800) pushes the element down below the right-floated one.

If someone has seen this problem before and has an idea of what I could
be
doing wrong, I would appreciate input. Thanks!
Welp, I tried my best, but I just can't visulaize it. Sorry.

--
Neredbojias
Infinity has its limits.
Jul 6 '06 #2
da******@hotmail.com wrote:
Hello. I'm noticing strange behavior in the way that Internet Explorer
positions elements following an element that has been floated to the
right.
Here is a simple test:
<div style="width: 800px; background-color: #CEF;">
<div style="width: 200px; float: right; background-color:
#FF0;">width: 200px; float: right; background-color: #FF0;<br />
width: 200px; float: right; background-color: #FF0;<br />
width: 200px; float: right; background-color: #FF0;</div>
<p>Unstyled text. Unstyled text. Unstyled text.</p>
<div style="width: 600px; background-color: #F66;">width: 600px;
background-color: #F66;<br />
width: 600px; background-color: #F66;<br />
width: 600px; background-color: #F66;<br />
Firefox and Opera correctly float this div up below the unstyled
text. Internet Explorer pushes it below the div floated to the
right.</div>
</div>
Forgive the poor explanation, but when you have the two inner widths adding
up to the exact width of the outer container, IE tends to do this. Change
the div with the 600px width to 598px or so.

David
Jul 6 '06 #3
da******@hotmail.com wrote:
Hello. I'm noticing strange behavior in the way that Internet Explorer
positions elements following an element that has been floated to the
right.

<div style="width: 800px;">
<div style="width: 200px; float: right;
<div style="width: 600px; ">
IE requires a bit if extra space around the <div>s (bogus feature). Make
the internal divs a little smaller, or the outer one larger.

--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 6 '06 #4

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

Similar topics

8
by: Bo Wisén | last post by:
Hi, A project in VB6 recently worked without any problems but now it's complaining when I try to use 'Right$'. In immediate mode, when I'm typing 'print left$("123456",2)' I get the correct...
12
by: Ted Mencini | last post by:
When I replaced older <IMG ALIGN=RIGHT ...> tags with a CSS definition <IMG class=right ...> xxx.css: IMG.right { BORDER: 0; align: right } I notice that the effect is NOT the same....
22
by: Marek Mand | last post by:
How to create a functional *flexible* UL-menu list <div> <ul> <li><a href=""></li> <li><a href=""></li> <li><a href=""></li> </ul> </div> (working in IE, Mozilla1.6, Opera7 (or maybe even...
2
by: Dr. Richard E. Hawkins | last post by:
I've googled around, and asked everyone I know, but I still can't find any reference to anyone else having faced this particular IE bug with floats. I've put a page at...
22
by: Simon | last post by:
Hi, I have written a function to trim char *, but I have been told that my way could be dangerous and that I should use memmove(...) instead. but I am not sure why my code could be 'dangerous'...
3
by: deanfamily11 | last post by:
Ok, here's another problem I'm having. I've tried several different things, but I just can't get anything to be right justified. Any thoughts? #include <iostream> #include <iomanip>...
19
by: ashkaan57 | last post by:
Hi, I have a page in a right-to-left language and I am trying to make some bulleted lists using <ul>, but it puts the bullets to the left. Is there any way I can set the bullets to be on the...
5
by: tshad | last post by:
I have a datagrid that I cannot get to right justify a money amount (which is just a label). No matter what I do - it still right justifies it. <asp:TemplateColumn Visible="true"...
12
by: Dio1080 | last post by:
Ok, I need help on a for loop nested program using for loops, I'm trying to use a patten that goes like this: 123456 12345 1234 123 12 1 but when I try it, it goes like this: 123456
3
by: happyse27 | last post by:
Hi All, I wanted to align the text box for user registration but the code just wont budge... Kindly advise what is wrong? Cheers... Andrew <HTML>
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.