Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Posts
    362
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Page resolution conditions

    I am trying to create a page where it will look the same if the screen is resolution 1024 x 768 or if the screen is resolution 800 x 600.

    The below finds the resolution but the page looks different depending on the resolution. Please advise how I can make a web page look the same no matter what the resolution?

    Code:
    <script>
    if ((screen.width>=1024) && (screen.height>=768)) 
    { 
    divWidth = 1024;
    divHeight = 768 ;
    document.write("high res 1024");
    } 
    else 
    { 
    divWidth = 1024;
    divHeight = 768 ;
    document.write("low res 800");
    }
    </script>
    </head>
    
    <body>
    <table width=100&#37;>
    <tr>
    <td><font size=+4>
    long scroll test where the page will scroll different width depending on resolution.....
    </font>
    </td>
    </tr>
    </table>
    </body>
    </html>
    In my above example the page width scrolling changes depending on resolution. I want it to be the same if either resolution is used.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    If you want it to look the same, than why are you using percentages instead of fixed widths?

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

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