Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 323583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:02:40+00:00 2026-05-12T09:02:40+00:00

What is the best approach for defining page width of a web app? Most

  • 0

What is the best approach for defining page width of a web app? Most of our users have 19″ monitors, but many run the apps from 14″ laptops, and some have 24″ monitors (assume it’s a max resolution). From what I know, the two most common methods are: using fixed width pages or dynamic (max) width (100%).

There are problems with either approach. If a page is fixed width optimized for a 14″ laptop, then there will be a lot of wasted space on larger monitors (e.g. even though over 30% of the screen is blank on the sides, the user will have to scroll down to get the content). I used to be a proponent of dynamic width until I started seeing pages, which looked great on 14″ and 19″ screens displayed, on 24″ monitors (the major issue is with right-aligned items, such as buttons, which become separated from the main content).

Ideally, I would want the page width to be dynamic (100%) until it reaches certain threshold (say, 600px). Is this possible? Is there a better alternative?

UPDATE: Just to clarify: I want the content of the page to be at 100% width, but within certain range, say 400px and 900px (so the user will see a horizontal scroll bar after resizing window to 300px width, and there will be white space on the sides if the window is resized to 1000px width, but between 400px and 900px, the content would auto adjust). Possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:02:40+00:00Added an answer on May 12, 2026 at 9:02 am

    One way to set a maximum width for a div or table is to use CSS Expressions

    div#myDiv
    {
         max-width: 980px; 
         min-width: 980px; 
         width: 980px; 
         width: expression(Math.max(Math.min((document.documentElement ?   document.documentElement.clientWidth : document.body.clientWidth) - 20, 1000), 980)+'px');
    }
    

    You can replace 980 with 600 in your case. I will often create a container div to hold say the header, and footer such that they will expand the entire width of the screen, while using a child div to contain the content. In this way you can constrain the content (using the above expression), while allowing it to expand / contract based on screen size up to the max-width you specify.

    ******* UPDATE *********
    Based on your clarifications on the comments, this example code should do what you want, if I understand you correctly. Page Header, Footer, Etc are auto sized to fit the screen, while the content is constrained to a max width of 600px wide, scaling smaller as neccesary.

    <html>
    <head>
        <style>
        div#contentDiv
        {
            max-width: 600px;
            width:expression(document.body.clientWidth > 600? "600px": "auto" ); 
            border: red 1px solid;
        }
        div#wrapper {width: auto; border: blue 1px solid;}
        </style>
    </head>
    <body>
    <div id="wrapper">
        <div id="contentDiv" style="height:686px; border: solid 1px red;"></div>
    </div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the best approach to managing NHibernate transaction using Autofac within web application?
What is the best approach to implement tabs that look like web applications on
Looking for the best approach for a non-image CSS Drop Shadow technique. I have
What would be the best approach for this? Seems so redundant to have to
What is the best approach for defining Interfaces in either C# or Java? Do
Looking for the best approach: I have a tabbar and a navigationbar. under the
What's the best approach to import multiple lines from a text_area in a form?
What is the best approach to handle authentication on a bunch of Javascript actions
What is the best approach for mocking out a static class in c#. For
What is the best approach to render a large number of 2D graphical elements

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.