Set page to fit window size

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cloudysky
    New Member
    • Mar 2007
    • 1

    Set page to fit window size

    I am a newbie here and a beginner with javascript/html - I would like to know is there a standard way to set your page fit to most if not all windows. My webpage has links, selected form in 1 single row table and images. I set the margin to 10px for xpos and ypos. I have tested the page on my PC, SonyLaptop and another laptop of widescreen. It seems to display differently. I tried to use screen.width and screen.height with JavaScript to define some of the width and height of my columns but it does not seem work!!!! Is it correct to say that the width and height must contains a constant and not variable? I.e width=10px and NOT width=aWidth where <script language="javas cript"> aWidth=20;</script> for example.

    Any suggestion is greatly appreciated.
    Regards
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Welcome to TSDN.

    If you want it to display the same width, you need to set the width to a fixed number. If you fir the width of the browser/screen, then use percentages.

    As for using javascript, you can set the width using, e.g.
    Code:
    obj.style.width="10px";

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Changed thread title.

      Comment

      Working...