...

View Full Version : Floated Images not working in Firefox



RedBarron
01-29-2007, 05:04 PM
I am floating images (either right or left) and they look fine in IE but in FF they shoot down to the bottom of the page. I've messed with the "clear" attribute, looked for inherited values that might be interfering, and more with no results. Here is a sample page where the images are not behaving: District Athletic Page (http://www.rrps.net/Newrrhs/athletics.htm)

Any ideas? Thanks in advance.

koyama
01-30-2007, 05:51 PM
Hi RedBarron
You have applied clear: right to the second newsblock on your right side. FF will not put any floats that appear later in your document higher up than this element (contrary to IE). This is not a bug in neither IE nor FF---they just happen to deal differently with floats.

I recommend that you take a look at floated layout using divs. This way you would use 1 div for each column, and no tables. There are plenty of good tutorials in the sticky section.

Using some of these methods, what you can do for now to fix your document is this. You currently have something like this:


.newsbox {
width: 180px;
vertical-align: top;
text-align: left;
margin: 5px 0px 5px 10px;
float: right;
line-height: 1.50em;
}
.newsbox2 {
padding: 0px;
width: 180px;
vertical-align: top;
text-align: left;
margin: 5px 0px 5px 10px;
clear: both;
float: right;
}

together with this:

<div class="newsbox">
...
</div>
<div class="newsbox">
...
</div>

Instead use this:


#right {
float: right;
}
.newsbox {
width: 180px;
vertical-align: top;
text-align: left;
margin: 5px 0px 5px 10px;
float: left;
line-height: 1.50em;
}
.newsbox2 {
padding: 0px;
width: 180px;
vertical-align: top;
text-align: left;
margin: 5px 0px 5px 10px;
clear: both;
float: left;
}

together with this:


<div id="right">
<div class="newsbox">
...
</div>
<div class="newsbox">
...
</div>
</div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum