Fluid layout - IE6 clichés the layout when resizing

This is a discussion on "Fluid layout - IE6 clichés the layout when resizing" within the Web Page Design section. This forum, and the thread "Fluid layout - IE6 clichés the layout when resizing are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 15th, 2007, 11:48
Up'n'Coming Member
Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Fluid layout - IE6 clichés the layout when resizing

Hi I am working on a table-less fluid layout that is fairly simple but I noticed when you resize the window in IE6 by dragging the edge of the window it sometimes displays the layout of the divs wrong. This does not happen in FF. Any help, yes please!

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>margins and padding</title>
<link href="css/global.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrap">
  <div id="container">
    <div id="leftcontainer"></div>
    <div id="middlecontainer"></div>
    <div id="rightcontainer"></div>
  </div>
  <div id="content">Content for id "content" Goes Here</div>
</div>
</body>
</html>
css:

Code: Select all
body {
 color: #000000;
 background-color: #FFFFFF;
 margin: 10px;
}
#wrap {
 width: 96%;
 background-color: #CCCCCC;
 margin-right: auto;
 margin-left: auto;
 height: 500px;
}
#leftcontainer {
 background-color: #666666;
 width: 30%;
 height: 80px;
 float: left;
}
#middlecontainer {
 background-color: #CCCCCC;
 width: 30%;
 height: 80px;
 float: left;
 margin-right: 5%;
 margin-left: 5%;
}
#rightcontainer {
 background-color: #666666;
 width: 30%;
 height: 80px;
 float: right;
}
#container {
 background-color: #FFFFFF;
 width: 100%;
 height: 80px;
}
#content {
 background-color: #666666;
 color: #FFFFFF;
 margin-top: 10px;
 margin-bottom: 10px;
}
Reply With Quote

  #2 (permalink)  
Old Jun 15th, 2007, 11:51
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

I wonder if it's because you are using % for the widths. It might be worth trying em's or pixels.
Reply With Quote
  #3 (permalink)  
Old Jun 15th, 2007, 11:54
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

Just found this http://css-discuss.incutio.com/?page=UsingPercent

Quote:
Note that you may experience problems in IE when using several percentages that add to 100%, probably due to rounding errors. For example, five images sized at 20% each may wrap onto a second line. If this happens, try setting a slightly smaller percentage (e.g. 19.9%) to make IE behave. You may wish to use a CssHack to hide this declaration from other browsers.
Reply With Quote
  #4 (permalink)  
Old Jun 15th, 2007, 12:57
VanessaJW's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Kent, England
Age: 37
Posts: 560
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

Quote:
Originally Posted by Lchad View Post
I wonder if it's because you are using % for the widths. It might be worth trying em's or pixels.
I thought a fluid layout had to be in %, no? Can it still be fluid in pixels?
Reply With Quote
  #5 (permalink)  
Old Jun 15th, 2007, 13:22
Ryan Fait's Avatar
SuperMember

SuperMember
Join Date: May 2006
Location: Las Vegas
Posts: 3,786
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

Yeah, you're right, Vanessa: em and pixel are set widths (em isn't exact all of the time), but you need percentages for a fluid layout. You're also right, Linda. Whether it's a rounding error or something else, IE doesn't always display things correctly when it's not exact.

In my experience, if you tell a browser to split something 50/50 when the width 3 pixels, there will be an extra pixel of space in there. It depends on the circumstances, but this is just one of those things that you need figure out a per-case incident.
Reply With Quote
  #6 (permalink)  
Old Jun 15th, 2007, 13:33
Up'n'Coming Member
Join Date: Jul 2005
Location: uk
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

[quote=Lchad;193940]Just found this

Thanks Lchad that seems to work. I changed the middlecontainer to 29.8% (didnt work at 29.9%).The only problem is that its not totally symmetrical now but at least it is cliche free. FF is so much better!

VanessaJW - a totally fluid layout can not be in pixels. You have to use % or ems. I am cheating and using pixel heights but % widths which makes life a little easier. For instance I have noticed that if you float divs within a parent div the parent div does not inherit the height of the child in FF but it does in IE6. Its all a bit tricky really especially if you want to validate to AA.

Last edited by cyberseed; Jun 15th, 2007 at 13:38. Reason: typo
Reply With Quote
  #7 (permalink)  
Old Jun 16th, 2007, 01:18
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

Quote:
Originally Posted by VanessaJW View Post
I thought a fluid layout had to be in %, no? Can it still be fluid in pixels?
It depends what you mean by "fluid".

When you set a design in px, then it can't be adjusted. Technically, it's a relative unit -- but it's relative to the viewing device, which isn't that helpful (most people won't change their screen resolution just to resize your website).

When you set a design in %, then it resizes depending on the window size.

When you set a design in em, then it resizes with the font (my favourite: you control the proportions and line length, but the user can resize the whole page).

Exception: setting font-sizes in em or % is the same: 1em = 100%. But make sure you set your base font size (in *, html, or body) using % and not em, because IE has a freaky text-resizing bug if you use em.

You can combine these with max-width for some added flexibility in low resolutions (content compresses when squeezed, rather than getting a horizontal scrollbar).

Last edited by MikeHopley; Jun 16th, 2007 at 01:28.
Reply With Quote
  #8 (permalink)  
Old Jun 16th, 2007, 05:14
VanessaJW's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Kent, England
Age: 37
Posts: 560
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Fluid layout - IE6 clichés the layout when resizing

Quote:
Originally Posted by MikeHopley View Post
Exception: setting font-sizes in em or % is the same: 1em = 100%. But make sure you set your base font size (in *, html, or body) using % and not em, because IE has a freaky text-resizing bug if you use em.
Thanks for the explanation Mike. I didn't realise you could actually set the font size in %, I thought you would always set the font in px or em, and it would just be your various widths that would be in %. I think I feel a bit more in control of things if I forget about fluid and just use px for everything; the display seems more certain that way. I can see the advantages though of % and em - I'll have to have a bit of a play with doing fluid layouts when I have time.

Last edited by VanessaJW; Jun 16th, 2007 at 05:15. Reason: Forgot to end quote
Reply With Quote
Reply

Tags
fluid layout, ie6 clichs

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 layout problems FF + IE when resizing browserwindow tilto Web Page Design 0 Mar 17th, 2008 08:55
where can I find a fluid 3 column layout Gerry Web Page Design 7 Nov 2nd, 2007 22:48
New to CSS Layout tapster Web Page Design 15 Oct 15th, 2007 10:18
new layout welshstew Webforumz Cafe 31 Oct 1st, 2007 16:56
What makes a layout a good layout? Miles Lombardi Graphics and 3D 4 Jul 26th, 2005 03:22


All times are GMT. The time now is 20:06.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43