SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member jitu78's Avatar
    Join Date
    Aug 2006
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flexible DIV with min/max width

    Hi,

    I am working on pure DIV based layout.
    See below for layout requirements,
    1) Page should be 100% flexible for all resolutions.
    2) There should be maximum and minimum limit for page width means page should be stretched to 1200 res. and on 800 res. there should be appear horizontal scroll.

    Max-width/Min-width works fine with firefox and other browsers, but IE is giving problem on resizing DIVs.

    Anyone there who know that how can I set max and min width for all browsers?

    Thanks in advanced.

    Jitendra
    globtier.com
    Globtier Solutions
    Outsource IT Smartly

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can use the Microsoft-specific proprietary expression(), preferably in an IE-only style sheet linked with conditional comments.

    For 'standards mode':
    Code:
    body {
      width:expression((d=document.documentElement.clientWidth) && (d>1200 ? "1200px" : d<800 ? "800px" : "auto"));
    }
    That will only work for IE users with JavaScript enabled, though. AFAIK, there's no way to achieve this without JS.
    Birnam wood is come to Dunsinane

  3. #3
    SitePoint Evangelist Ed Seedhouse's Avatar
    Join Date
    Aug 2006
    Location
    Victoria, B.C. Canada
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jitu78
    I am working on pure DIV based layout.
    Well stop!

    All DIVs is just as bad as all tables. Your page should be marked up semantically so the tags you use reflect the meaning or structure of the content.

    DIVs should be used strategically only, to create hooks for your CSS rules that otherwise wouldn't be there.
    Ed Seedhouse


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •