Google Answers Logo
View Question
 
Q: HTML / CSS Problem with relative positioned iframe and window resizing ( Answered 4 out of 5 stars,   3 Comments )
Question  
Subject: HTML / CSS Problem with relative positioned iframe and window resizing
Category: Computers > Internet
Asked by: trimidium-ga
List Price: $3.50
Posted: 20 Aug 2002 14:23 PDT
Expires: 19 Sep 2002 14:23 PDT
Question ID: 56678
HTML / CSS Problem, I made a website that has an iframe for a "monitor
screen".  I want the monitor to be centered on the screen.  The
problem is when you resize the page the iframe doesn't move to the
correct spot unless you refresh the page.  What I need is either a fix
for the actual iframe problem or a way to make the page refresh when
somebody resizes the window.

I do not want to make the page positioned absolute either, it must be
relative so the page can be centered on any screen resolution.

Click below to go to the problem page: 
http://www.gameserver.net/nav1024.php
Answer  
Subject: Re: HTML / CSS Problem with relative positioned iframe and window resizing
Answered By: prophet-ga on 22 Aug 2002 14:15 PDT
Rated:4 out of 5 stars
 
Hi Trimidium,

There are many ways to accomplish what you'd like to do.  Some
involving DHTML tend to get quite complicated, so let's stick with the
easy solution for now.

The easiest way to fix your problem is to add an attribute to the
<body> tag of your page.  You have two options.  You can change your
tag from:
<body style="margin: 2px;" bgcolor="black">
to:
1. <body style="margin: 2px;" bgcolor="black"
onresize="history.go(0)">
or to:
2. <body style="margin: 2px;" bgcolor="black"
onresize="document.location.reload()">

I think you'd prefer option 1, which performs a "soft" reload.  This
type of reload does not reset your form elements to their default
values.  Option 2, a "hard" reload, will reset the forms on the page.

Cheers,
Prophet
trimidium-ga rated this answer:4 out of 5 stars
That did just what I needed it to, Thanks!

Comments  
Subject: Re: HTML / CSS Problem with relative positioned iframe and window resizing
From: seizer-ga on 20 Aug 2002 14:34 PDT
 
I imagine that Internet Explorer's layout engine wouldn't support
that, but I'm not sure.

Incidentally, your page doesn't render very well in Mozilla (v1.01) on
WinXP- you have to scroll down one screen before anything appears.
Subject: Re: HTML / CSS Problem with relative positioned iframe and window resizing
From: lot-ga on 20 Aug 2002 15:50 PDT
 
Seems OK on my browser Mac I.E 5.5
iFrame doesn't work with older versions of Netscape prior to 6.0 I believe.
lot-ga
Subject: Re: HTML / CSS Problem with relative positioned iframe and window resizing
From: yeff-ga on 20 Aug 2002 16:00 PDT
 
iframe is slow and not just a little bit evil.  Use SSI or
overflow:scroll; and have the text on the page itself.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy