Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

General discussion

Browser window size control

May 25, 2005 1:54AM PDT

Hello Cnet world - I am trying to create a home page for a new website that opens the IE browser so that it just fits the page content. The behavior I'm looking for is:
- I enter the URL for my web page in the Address window of the browser (not an href link from an open web page)
- My web page opens in the same browser and adjusts its size to fit the content of my page.

This is the behavior I see for many web pages but I can't find the right html or js to make it happen. Setting the <body TOPMARGIN="0" LEFTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0" doesn't do it.

Thanks

Discussion is locked

- Collapse -
use resizeTo()
May 25, 2005 8:18AM PDT

like so

<body onload="resizeTo(300,400)">

where 300 is the width and 400 is the height of the window

- Collapse -
resizeto works fine
May 25, 2005 11:04AM PDT

Thanks

- Collapse -
glad i could help
May 26, 2005 7:38AM PDT
Happy