Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Fill the browser window.

I want to insert an image into a frame so that when the browser opens, the image fills the frame (ie whole bottom of the screen) regardless of what browser is being used. I dont want to overfill/ underfill the screen (ie I dont want any sideways scrolling to be necessary. Whats the answer oh experts.
1 Solution
>>Whats the answer oh experts.<<

You can do some javascripting to resize the graphic according to the window's size, but I would personally go with a 100% width Flash anim.

BTW: Did I welcome you already? Welcome to EE!
Insert a table and set the width and height to 100% then add your image and set the wdth to 100% (the height should adjust in proportion to this so that you don't get distortion)
Hi sebastiz,

Not sure how you're positioning your iframe to stay at the bottom, but here's how to make the image fill it:

<iframe scrolling="no" id="foo" name="foo" height="400" width="100%" frameborder="0" hspace="0"
vspace="0" marginheight="0" marginwidth="0" src="img.htm"></iframe>

In img.htm use this:

<body bottommargin="0" leftmargin="0" rightmargin="0" topmargin="0">
<script type="text/javascript">
document.write('<img src="images/yourimage.png" height="'+top.document.getElementById('foo').height+'" width="100%">');

If your iframe is being dynamically positioned this won't work, but you didn't mention such so I'm assuming it has fixed height.

Hope this helps!

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now