Forum Moderators: not2easy

Message Too Old, No Replies

Having problems with this div floating to the right in firefox

Divs don't seem to float the same in ineternet explorer versus Firefox.

         

mrmckoy

4:55 am on Oct 11, 2007 (gmt 0)

10+ Year Member



So i've set this DIV to float to the right. That's a great thing except that it's really not working right.

In internet explorer it floats to the right of the screen correctly.

in firefox it doesn't float at all.
please help :(

This is the code i'm using.

<div id="mmt_180_150" style="position: absolute; top: 150px; align=right; float: right;">

#mmt_180_150 {
border: 1px;
border-style: solid;
border-color: #D9D9D9;
border-left: 0px;
background: #fafafa;
padding: 4px;
width: 180px;
margin-top: 150px;
float: right;
}

[edited by: jatar_k at 5:33 pm (utc) on Oct. 30, 2007]
[edit reason] no urls thanks [/edit]

Marshall

5:18 am on Oct 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



First, welcome to WebmasterWorld.

In several instances, you are combining two things that do not mix.

First;

<div id="mmt_180_150" style="position: absolute; top: 150px; align=right; float: right;">

You cannot have align=right in a style. Also, you have:

#mmt_180_150 {
border: 1px;
border-style: solid;
border-color: #D9D9D9;
border-left: 0px;
background: #fafafa;
padding: 4px;
width: 180px;
margin-top: 150px;
float: right;

}

and

<div id="mmt_180_150" style="position: absolute; top: 150px; align=right; float: right;">

Remove the in-line style from the <div> tag and it should solve your problem.

On a side note, you can shorthand the border description:

border: 1px solid #D9D9D9;

instead of

border: 1px; /* and it is safer to say border-width: 1px; */
border-style: solid;
border-color: #D9D9D9;

Marshall