Min width in window resizing

后端 未结 2 561
悲哀的现实
悲哀的现实 2020-12-08 02:24

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 th

相关标签:
2条回答
  • 2020-12-08 02:59

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

    body{
       min-width:1000px;        /* Suppose you want minimum width of 1000px */
       width: auto !important;  /* Firefox will set width as auto */
       width:1000px;            /* As IE6 ignores !important it will set width as 1000px; */
    }
    

    Or:

    body{
       min-width:1000px; // Suppose you want minimum width of 1000px
       _width: expression( document.body.clientWidth > 1000 ? "1000px" : "auto" ); /* sets max-width for IE6 */
    }
    
    0 讨论(0)
  • 2020-12-08 03:23

    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.

    0 讨论(0)
提交回复
热议问题