Fill the browser window.

Posted on 2004-11-26
Last Modified: 2010-08-05
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.
Question by:sebastiz
    LVL 14

    Expert Comment

    >>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!
    LVL 1

    Expert Comment

    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)
    LVL 10

    Accepted Solution

    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!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
    This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now