www.webdeveloper.com
Results 1 to 7 of 7

Thread: Iframe Auto Fit

  1. #1
    Join Date
    Dec 2004
    Posts
    54

    Iframe Auto Fit

    Can anybody pls help....Is there anyway to make the IFRAME AUTO-FIT to whatever page that will be displayed? tnx! in advance....

    -daimous

  2. #2
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    1) What do you mean "AUTO-FIT" ? As in taking up the entire dimensions of the page? Or of the browser window?

    2) Why do you wish to do this?

    3) Why are you using an I-Frame?

  3. #3
    Join Date
    Dec 2004
    Posts
    54
    AUTO-FIT? to fit the page automatically to the frame or taking up tha entire dimension of the page in a frame...i use IFRAME to make a single frame to whatever postion i like...

  4. #4
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en" dir="ltr">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="Content-Style-Type" content="text/css">
    <meta http-equiv="content-script-type" content="text/javascript">
    <title></title>
    </head>
    <body style="padding:0%;margin:0%;">
    <iframe src="page.html" style="width:100%;height:100%;"></iframe>
    </body>
    </html>
    With that said, never use IFrames or Frames unless one absolutely has to.

  5. #5
    Join Date
    Dec 2004
    Posts
    54
    tnx! for that..but I need a frame that will automatically fit the entire dimension of whatever page that will be displayed and at the same time the frame will automatically fit itself to the browser to get rid of the scroll bars...for example, i have this main page that has a frame and in that frame there is a page that has a height that is longer than the said frame of course if that the case the frame will automatically provide a Vertical scroll bar, by dafult... And the reason why i want to fit the page that will be displayed automatically in the frame, and at the same time the frame will automatically fit itself to the browser, is to get rid of the scroll bars....hope u got my question....tnx!

  6. #6
    Join Date
    Sep 2013
    Posts
    1
    try this one..
    in the head portion call a style and define an id as shown below,, followed with the html code....

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <style>
    #page
    {
    margin:0;
    padding:0;
    height:100%;
    width:100%;
    position:fixed;
    }
    </style>
    </head>

    <body>

    <iframe id="page" src="yourpage.html" scrolling="no">
    </iframe>

    </body>
    </html>

  7. #7
    Join Date
    Mar 2012
    Posts
    1,814
    There is no way I am aware of to do what is asked in the OP. This would be possible if the target page were responsive, and fitted itself to the display area allocated to it, but not for a standard fixed-width site picked at random.
    Last edited by jedaisoul; 09-16-2013 at 06:18 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles