Web Analytics Made Easy -
StatCounter Resizing DIVs to max width - CodingForum

Announcement

Collapse
No announcement yet.

Resizing DIVs to max width

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resizing DIVs to max width

    Hi All,

    I want to create a flexible DIV based layout.

    Here is design layout, globtier 1st template

    Layout should have horizontal scrolled on 800 resolutions.
    And, It should not stretch after 1200 page width, that means pages should be stretch from 800 to 1200 px in width.

    It should support at least IE/Firefox and Opera browser.

    Can you help me to create this layout?


    Thanks
    jits
    Web 2.0 Expert

  • #2
    Here's the necessary CSS to do that for. Firefox, Opera, IE7, etc all understand min-width and max-width but IE6 doesn't so we use the second line which is an IE6 hack to get around that limitation.

    Code:
    <style>
    body width:100%;min-width:800px;max-width:1200px;}
    * html body{width: expression(document.body.clientWidth > 1200 ? "1200px" : (document.body.clientWidth < 801 ? "800px" : "100%"));}
    }
    </style>
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

    Comment


    • #3
      Stephen code are really fantastic

      Thanks Stephen

      Your code works for my layout......
      jits
      Web 2.0 Expert

      Comment

      Working...
      X