views:

25

answers:

2

Hi, I have a webpage with a fluid layout with a 100% width.

When I resize browser window the elements in the page overlap.

I would create an effect similar to this website http://bologna.bakeca.it/ that when window is smaller than a fixed width stop resizing.

A: 

You can set min-width property of CSS for body tag. Since this property is not supported by IE 6 you can write like

body{
   min-width:1000px; /* suppose you want minimun width of 1000px */
   width: auto !important;  /* Firefox will set width as auto */
   width:100px;             /* As IE ignores !important it will set width as 1000px; */
}

Or

body{
   min-width:1000px; // suppose you want minimun width of 1000px
   _width: expression( document.body.clientWidth > 1000 ? "1000px" : "auto" ); /* sets max-width for IE */
}
Chinmayee
A: 

Well, you pretty much gave yourself the answer. In your CSS give the containing element a min-width. If you have to support IE6 you can use the min-width-trick:

#container {
    min-width:800px;
    width: auto !important;
    width:800px;
}

That will effectively give you 800px min-width in IE6 and any up-to-date browsers.

DanMan