Forum Moderators: not2easy

Message Too Old, No Replies

float:right in IE is acting more like align:right

         

narowgate

8:43 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



Using the css class below, in IE content does not wrap around this div, it is simply pushed down to the next line. Any ideas?

.box
{float:right;
width:200px;
border-style:dotted;
border-width:3px;
border-color:#8EC551;
background-color:#C6E2A8;
padding:20px;
margin:0px 0px 20px 20px;
}

createErrorMsg

9:05 pm on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's impossible to tell why non-floated content would move down the screen without seeing the code for other elements, namely any containers these two elements are in and the code for the element that is moving. Also, the source code would be helpful, since proper float behavior depends upon the source code order for the elements in question.

I would start by making sure the float comes before the element you want it floating next to in the source code...

<div id="thefloat"></div>
<div id="theNOTfloat"></div>

Next, check to be sure the item you're expecting to wrap around the float isn't also set to float. This would produce the behavior you describe.

Otherwise, it could be that the width of the non-floated element is being forced to a width too wide for it to sit adjacent to the float. Or something in your layout has triggered the IE float bug suite. Or you've got a double margin effect. OR...OR...OR...

You can see why more code is necessary. ;)

cEM

narowgate

9:30 pm on Jan 18, 2005 (gmt 0)

10+ Year Member



Sorry, I was referenced here and under the impression I could not post links. It's not any of the problems you mentioned... except tell me about the double margin or triggering an IE float bug? It could be that?

You can see the behavior at : <snip>
the php is pulling in this content code: <snip>
which for some reason if I place the float directly on the div and view only the html file it works, so perhaps there is a conflict in the php file

the stylesheet is at:
<No site specifics, thanks. See TOS #13 [WebmasterWorld.com]>

Thanks,
Rick

[edited by: SuzyUK at 5:33 pm (utc) on Jan. 21, 2005]

benihana

9:34 pm on Jan 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



under the impression I could not post links

thats correct. but you can get help.

maybe you need to post the html/css for the containing elements, and anything next to them that may push them down.

what doctype are you using? do your pages validate?

<added>

except tell me about the double margin or triggering an IE float bug

the floating double margin bug doesnt apply, AFAIK , as you are floating right, and your right margin is 0, so even if it were doubled it wouldnt make any difference.

</added>

SuzyUK

5:44 pm on Jan 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



so perhaps there is a conflict in the php file

No there shouldn't be a conflict in a php "file".. it's the generated code of the entire document that you're interested in.

Oh hang on... I seem to remember something about using PHP includes produced a weird looking comment at the very beginning of a document (view source)? If It's doing that then IE will be going into quirks mode, which would cause Box Model problems..

There is a way around this but I can't remember what it is, if that's it let us know and someone will remember hopefully

If not try to narrow down the generated template to a basic main layout sample and post the code

Suzy