views:

76

answers:

3

Hi,

Trying to figure out how IE and Firefox (and any other browsers) treat css for divs differently. I set up three simple divs which display fine in IE(7), but don't display "right" in FireFox(3.0.8). Not complicated, just need a left panel, header and somewhere for the main content. For some reason, in FireFox the header only shows at 400px w instead of the 650px like it should. Can someone point me in right direction to get a good handle on this?

Have a client mockup I already setup this way, then realized FF was messed up. Can post URL for that if helps see what I'm trying to do?

#container
{
position: absolute;   
width: 900px;
left: 50%;
margin-left: -450px;         
top: 0%;
height: 500px;
background-color: Red;
}


#leftContent
{    
width: 250px;
float: left;
height: 500px;
background-color: Green;
}

#header
{       
width: 650px;
height: 150px;
background-color: Lime;
display: block;
}
A: 

try

float:right;

on #maincontent

UPDATE-

alt text

Vinay B R
tries float:right, left, table breaks in exact same way
Brad
try moving your header div above your leftcontent div
Vinay B R
tried, and IE and FF both broke in in same way (consistent at least)
Brad
i am a little confused here. i have updated my answer to include an img of how i see it. let me know whats ur expected result.
Vinay B R
thats exactly right. but my (win) FF breaks it as does my (mac)clients. im tring to figure out why the two (or more) interpret divs differently
Brad
how do i add imgs/code after a post if made and Im just adding comments?
Brad
have you moved your you div header above your leftcontent div.what do you mean by divs break.
Vinay B R
upload the img somewhere and post a link
Vinay B R
ftp.planbam.com
Brad
u: helpbrad p: *1helpbrad - best could come up with short notice
Brad
this should all work: steps to follow. 1) move div#header to be first item in div#container. 2) float div#header right. 3) float div#mainContent left. As a general rule I always work on FF first since it is less forgiving (in a good way) than IE. Your mockup site looks the same on FF and IE8
lnrbob
logo still drops out on my client mockup, but did fix the 3 div sample page i was trying to run to get started. ftp me the css u used to do that via above info?
Brad
couldn't ftp - new answer below
lnrbob
A: 

Add float:left to the header and mainContent.

#leftContent
{    
    width: 250px;
    float: left;
    height: 500px;
    background-color: Green;
    float: left;    
}

#header
{       
    width: 650px;
    height: 150px;
    background-color: Lime;
    display: block;
    float: left;
}

#mainContent 
{
    background-color: Black;
    height: 550px;
    width: 650px;
    float: left;
}
skajfes
#maincontent still drops and gets clippled by the logo, but works in IE
Brad
Hm, it looks fine to me here. But I have FF 3.6.10, and Chrome 7.0.
skajfes
A: 

ftp doesn't work for me. http://jsbin.com/ocare3/

Tried a new tack - added a wrapper to the right hand content (#header and #mainContent) and floated that. You also had at the end of the body but no opener...wierd. Anyway - this works for all my browsers. You may want to readdress the height values you have used to make sure everything lines up again

lnrbob
my bad! ftp link is working again with current fixes. was newbie paranoid, sorry :( IE works great, FF much closer but if anyone wants to take a look, please! - and @fontface HelVetStdCnd? is that working everywhere?
Brad
meant the @fontface embedding, but i'm getting off thread
Brad
Can't comment on main question anymore because my demo looks the same in my FF (3.6) as your mockup did in IE7. Might be helpful if you posted what the issue is (maybe a screenshot?). Fontface is slightly off topic but here is a useful generator: http://www.fontsquirrel.com/fontface/generator
lnrbob